mirror of
https://github.com/dalathegreat/Battery-Emulator.git
synced 2025-10-03 09:49:32 +02:00
bugfix - ordering is oposite in events page and mqtt publish
This commit is contained in:
parent
086c3dfa29
commit
eb901da385
4 changed files with 14 additions and 5 deletions
|
@ -463,14 +463,22 @@ static void update_bms_status(void) {
|
|||
}
|
||||
}
|
||||
|
||||
// Function to compare events by timestamp
|
||||
bool compareEventsByTimestamp(const EventData& a, const EventData& b) {
|
||||
// Function to compare events by timestamp descending
|
||||
bool compareEventsByTimestampDesc(const EventData& a, const EventData& b) {
|
||||
if (a.event_pointer->millisrolloverCount != b.event_pointer->millisrolloverCount) {
|
||||
return a.event_pointer->millisrolloverCount > b.event_pointer->millisrolloverCount;
|
||||
}
|
||||
return a.event_pointer->timestamp > b.event_pointer->timestamp;
|
||||
}
|
||||
|
||||
// Function to compare events by timestamp ascending
|
||||
bool compareEventsByTimestampAsc(const EventData& a, const EventData& b) {
|
||||
if (a.event_pointer->millisrolloverCount != b.event_pointer->millisrolloverCount) {
|
||||
return a.event_pointer->millisrolloverCount < b.event_pointer->millisrolloverCount;
|
||||
}
|
||||
return a.event_pointer->timestamp < b.event_pointer->timestamp;
|
||||
}
|
||||
|
||||
static void update_event_level(void) {
|
||||
EVENTS_LEVEL_TYPE temporary_level = EVENT_LEVEL_INFO;
|
||||
for (uint8_t i = 0u; i < EVENT_NOF_EVENTS; i++) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue