We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 39b02be commit da3f4a6Copy full SHA for da3f4a6
src/dimmerTask.cpp
@@ -1,6 +1,6 @@
1
#include "dimmerTask.hpp"
2
3
-static unsigned long long msSinceMidnight()
+static unsigned int msSinceMidnight()
4
{
5
// Time should already be synced through SNTP!
6
struct timeval now;
@@ -9,14 +9,13 @@ static unsigned long long msSinceMidnight()
9
struct tm currentTime;
10
localtime_r(&now.tv_sec, ¤tTime);
11
12
- int secondsSinceMidnight =
+ unsigned int secondsSinceMidnight =
13
currentTime.tm_hour * 3600 +
14
currentTime.tm_min * 60 +
15
currentTime.tm_sec;
16
17
- unsigned long long millisecondsSinceMidnight =
18
- (unsigned long long)secondsSinceMidnight * 1000ULL +
19
- now.tv_usec / 1000;
+ unsigned int millisecondsSinceMidnight =
+ secondsSinceMidnight * 1000U + now.tv_usec / 1000;
20
21
return millisecondsSinceMidnight;
22
}
0 commit comments