mirror of
https://github.com/dalathegreat/Battery-Emulator.git
synced 2025-10-04 10:19:29 +02:00
Use safe get_timestamp
This commit is contained in:
parent
001d254cd3
commit
276a548e9d
1 changed files with 3 additions and 3 deletions
|
@ -16,6 +16,8 @@ button:hover { background-color: #3A4A52; }</style>
|
||||||
</script>
|
</script>
|
||||||
)=====";
|
)=====";
|
||||||
|
|
||||||
|
uint64_t get_timestamp(unsigned long currentMillis);
|
||||||
|
|
||||||
static std::vector<EventData> order_events;
|
static std::vector<EventData> order_events;
|
||||||
|
|
||||||
String events_processor(const String& var) {
|
String events_processor(const String& var) {
|
||||||
|
@ -37,9 +39,7 @@ String events_processor(const String& var) {
|
||||||
}
|
}
|
||||||
// Sort events by timestamp
|
// Sort events by timestamp
|
||||||
std::sort(order_events.begin(), order_events.end(), compareEventsByTimestampDesc);
|
std::sort(order_events.begin(), order_events.end(), compareEventsByTimestampDesc);
|
||||||
uint64_t current_timestamp =
|
uint64_t current_timestamp = get_timestamp(millis());
|
||||||
(uint64_t)datalayer.system.status.millisrolloverCount * (uint64_t)std::numeric_limits<uint32_t>::max() +
|
|
||||||
(uint64_t)millis();
|
|
||||||
|
|
||||||
// Generate HTML and debug output
|
// Generate HTML and debug output
|
||||||
for (const auto& event : order_events) {
|
for (const auto& event : order_events) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue