Add a 64-bit millis64() function to avoid rollover issues

This commit is contained in:
Jonny 2025-07-24 08:34:01 +01:00
parent 6f83a1c905
commit 4ad621f6c3
6 changed files with 26 additions and 26 deletions

View file

@ -2,6 +2,7 @@
#include <limits>
#include "../../datalayer/datalayer.h"
#include "../../devboard/utils/logging.h"
#include "../../devboard/utils/millis64.h"
const char EVENTS_HTML_START[] = R"=====(
<style>body{background-color:#000;color:#fff}.event-log{display:flex;flex-direction:column}.event{display:flex;flex-wrap:wrap;border:1px solid #fff;padding:10px}.event>div{flex:1;min-width:100px;max-width:90%;word-break:break-word}</style><div style="background-color:#303e47;padding:10px;margin-bottom:10px;border-radius:25px"><div class="event-log"><div class="event" style="background-color:#1e2c33;font-weight:700"><div>Event Type</div><div>Severity</div><div>Last Event</div><div>Count</div><div>Data</div><div>Message</div></div>
@ -17,8 +18,6 @@ button:hover { background-color: #3A4A52; }</style>
</script>
)=====";
uint64_t get_timestamp(unsigned long currentMillis);
static std::vector<EventData> order_events;
String events_processor(const String& var) {
@ -40,7 +39,7 @@ String events_processor(const String& var) {
}
// Sort events by timestamp
std::sort(order_events.begin(), order_events.end(), compareEventsByTimestampDesc);
uint64_t current_timestamp = get_timestamp(millis());
uint64_t current_timestamp = millis64();
// Generate HTML and debug output
for (const auto& event : order_events) {