File tree Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Original file line number Diff line number Diff line change 1
1
#include " dimmerTask.hpp"
2
2
3
- static unsigned long long msSinceMidnight ()
3
+ static unsigned int msSinceMidnight ()
4
4
{
5
5
// Time should already be synced through SNTP!
6
6
struct timeval now;
@@ -9,14 +9,13 @@ static unsigned long long msSinceMidnight()
9
9
struct tm currentTime;
10
10
localtime_r (&now.tv_sec , ¤tTime);
11
11
12
- int secondsSinceMidnight =
12
+ unsigned int secondsSinceMidnight =
13
13
currentTime.tm_hour * 3600 +
14
14
currentTime.tm_min * 60 +
15
15
currentTime.tm_sec ;
16
16
17
- unsigned long long millisecondsSinceMidnight =
18
- (unsigned long long )secondsSinceMidnight * 1000ULL +
19
- now.tv_usec / 1000 ;
17
+ unsigned int millisecondsSinceMidnight =
18
+ secondsSinceMidnight * 1000U + now.tv_usec / 1000 ;
20
19
21
20
return millisecondsSinceMidnight;
22
21
}
You can’t perform that action at this time.
0 commit comments