Add clearing of overrun event

This commit is contained in:
Daniel Öster 2024-06-13 23:36:52 +03:00
parent 4c9a08b8c0
commit 9346632b95
12 changed files with 24 additions and 0 deletions

View file

@ -687,6 +687,8 @@ void send_can_battery() {
// Check if sending of CAN messages has been delayed too much.
if ((currentMillis - previousMillis20 >= INTERVAL_20_MS_DELAYED) && (currentMillis > BOOTUP_TIME)) {
set_event(EVENT_CAN_OVERRUN, (currentMillis - previousMillis20));
} else {
clear_event(EVENT_CAN_OVERRUN);
}
previousMillis20 = currentMillis;

View file

@ -264,6 +264,8 @@ void send_can_battery() {
// Check if sending of CAN messages has been delayed too much.
if ((currentMillis - previousMillis50 >= INTERVAL_50_MS_DELAYED) && (currentMillis > BOOTUP_TIME)) {
set_event(EVENT_CAN_OVERRUN, (currentMillis - previousMillis50));
} else {
clear_event(EVENT_CAN_OVERRUN);
}
previousMillis50 = currentMillis;

View file

@ -689,6 +689,8 @@ void send_can_battery() {
// Check if sending of CAN messages has been delayed too much.
if ((currentMillis - previousMillis100 >= INTERVAL_100_MS_DELAYED) && (currentMillis > BOOTUP_TIME)) {
set_event(EVENT_CAN_OVERRUN, (currentMillis - previousMillis100));
} else {
clear_event(EVENT_CAN_OVERRUN);
}
previousMillis100 = currentMillis;

View file

@ -188,6 +188,8 @@ void send_can_battery() {
// Check if sending of CAN messages has been delayed too much.
if ((currentMillis - previousMillis100 >= INTERVAL_100_MS_DELAYED) && (currentMillis > BOOTUP_TIME)) {
set_event(EVENT_CAN_OVERRUN, (currentMillis - previousMillis100));
} else {
clear_event(EVENT_CAN_OVERRUN);
}
previousMillis100 = currentMillis;

View file

@ -377,6 +377,8 @@ void send_can_battery() {
// Check if sending of CAN messages has been delayed too much.
if ((currentMillis - previousMillis500ms >= INTERVAL_500_MS_DELAYED) && (currentMillis > BOOTUP_TIME)) {
set_event(EVENT_CAN_OVERRUN, (currentMillis - previousMillis500ms));
} else {
clear_event(EVENT_CAN_OVERRUN);
}
previousMillis500ms = currentMillis;
// Section added to close contractor

View file

@ -525,6 +525,8 @@ void send_can_battery() {
// Check if sending of CAN messages has been delayed too much.
if ((currentMillis - previousMillis10 >= INTERVAL_10_MS_DELAYED) && (currentMillis > BOOTUP_TIME)) {
set_event(EVENT_CAN_OVERRUN, (currentMillis - previousMillis10));
} else {
clear_event(EVENT_CAN_OVERRUN);
}
previousMillis10 = currentMillis;

View file

@ -125,6 +125,8 @@ void send_can_battery() {
// Check if sending of CAN messages has been delayed too much.
if ((currentMillis - previousMillis10 >= INTERVAL_10_MS_DELAYED) && (currentMillis > BOOTUP_TIME)) {
set_event(EVENT_CAN_OVERRUN, (currentMillis - previousMillis10));
} else {
clear_event(EVENT_CAN_OVERRUN);
}
previousMillis10 = currentMillis;

View file

@ -559,6 +559,8 @@ void send_can_battery() {
// Check if sending of CAN messages has been delayed too much.
if ((currentMillis - previousMillis10 >= INTERVAL_10_MS_DELAYED) && (currentMillis > BOOTUP_TIME)) {
set_event(EVENT_CAN_OVERRUN, (currentMillis - previousMillis10));
} else {
clear_event(EVENT_CAN_OVERRUN);
}
previousMillis10 = currentMillis;

View file

@ -125,6 +125,8 @@ void send_can_battery() {
// Check if sending of CAN messages has been delayed too much.
if ((currentMillis - previousMillis100 >= INTERVAL_100_MS_DELAYED) && (currentMillis > BOOTUP_TIME)) {
set_event(EVENT_CAN_OVERRUN, (currentMillis - previousMillis100));
} else {
clear_event(EVENT_CAN_OVERRUN);
}
previousMillis100 = currentMillis;
//ESP32Can.CANWriteFrame(&ZOE_423);

View file

@ -123,6 +123,8 @@ void send_can_battery() {
// Check if sending of CAN messages has been delayed too much.
if ((currentMillis - previousMillis10 >= INTERVAL_10_MS_DELAYED) && (currentMillis > BOOTUP_TIME)) {
set_event(EVENT_CAN_OVERRUN, (currentMillis - previousMillis10));
} else {
clear_event(EVENT_CAN_OVERRUN);
}
previousMillis10 = currentMillis;

View file

@ -568,6 +568,8 @@ the first, for a few cycles, then stop all messages which causes the contactor
// Check if sending of CAN messages has been delayed too much.
if ((currentMillis - previousMillis30 >= INTERVAL_30_MS_DELAYED) && (currentMillis > BOOTUP_TIME)) {
set_event(EVENT_CAN_OVERRUN, (currentMillis - previousMillis30));
} else {
clear_event(EVENT_CAN_OVERRUN);
}
previousMillis30 = currentMillis;

View file

@ -331,6 +331,8 @@ void send_can_battery() {
// Check if sending of CAN messages has been delayed too much.
if ((currentMillis - previousMillis100 >= INTERVAL_100_MS_DELAYED) && (currentMillis > BOOTUP_TIME)) {
set_event(EVENT_CAN_OVERRUN, (currentMillis - previousMillis100));
} else {
clear_event(EVENT_CAN_OVERRUN);
}
previousMillis100 = currentMillis;