Fixed uptime rollover in UI

This commit is contained in:
Gunnar Skjold
2020-03-08 19:47:47 +01:00
parent 9b70802450
commit c07c2e66d6
5 changed files with 25 additions and 4 deletions

8
src/Uptime.cpp Normal file
View File

@@ -0,0 +1,8 @@
#include "Uptime.h"
uint64_t millis64() {
uint32_t new_low32 = millis();
if (new_low32 < _uptime_last_value) _uptime_rollovers++;
_uptime_last_value = new_low32;
return (uint64_t) _uptime_rollovers << 32 | _uptime_last_value;
}