MEB: Fix contactors incorrectly opening after 49 days. (#1308)

Fixed rollover millis bug (#1308)
This commit is contained in:
Daniel Öster 2025-07-15 21:18:28 +03:00 committed by GitHub
parent 917d27e134
commit 3c0928d7fc
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1290,7 +1290,7 @@ void MebBattery::handle_incoming_can_frame(CAN_frame rx_frame) {
void MebBattery::transmit_can(unsigned long currentMillis) { void MebBattery::transmit_can(unsigned long currentMillis) {
if (currentMillis > last_can_msg_timestamp + 500) { if (currentMillis - last_can_msg_timestamp > 500) {
#ifdef DEBUG_LOG #ifdef DEBUG_LOG
if (first_can_msg) if (first_can_msg)
logging.printf("MEB: No CAN msg received for 500ms\n"); logging.printf("MEB: No CAN msg received for 500ms\n");