-
Notifications
You must be signed in to change notification settings - Fork 159
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Event handling! Unit tests! #170
Conversation
Update to checkout@v4
…attery-Emulator into feature/event-log
trigger commit
…attery-Emulator into feature/event-log
One thing to fix, hopefully soon: The ERROR level has priority over DEBUG, so OTA updates do not change the color to blue at the moment. Will see if I can make a quickfix |
@@ -12,13 +13,14 @@ int ESP32CAN::CANWriteFrame(const CAN_frame_t* p_frame) { | |||
tx_ok = (result == 0) ? true : false; | |||
if (tx_ok == false) { | |||
Serial.println("CAN failure! Check wires"); | |||
LEDcolor = 3; | |||
set_event(EVENT_CAN_FAILURE, 0); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This CAN failure is not the same as the other ones. This means nobody is acking messages on the bus, wires might be disconnected or termination resistance not good. This is more of a complete CAN failure. The other ones are more battery missing on CAN. We should have separate events for these two
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can add an event and split RX/TX, no probs
WHAT
Events: More complete event handling, that also handles system reactions and handles event logging to EEPROM
Unit tests: A simple unit test framework.
WHY
Events: Easier to add events and handle events in a more deterministic manner
Unit tests: A way to more easily verify functionality, and use for regression testing
HOW
Events: Centralization of bms_status handling, led_color, event message handling, etc etc., plus an EEPROM log
Unit tests: Adding a header-only unit test framework and unit-test Github Action