Merge pull request #1318 from dalathegreat/bugfix/i3-startup

Handle WUP pin better for reboots
This commit is contained in:
Daniel Öster 2025-07-19 21:21:51 +03:00 committed by GitHub
commit fc20d6b7f6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -44,7 +44,7 @@ uint8_t BmwI3Battery::increment_alive_counter(uint8_t counter) {
void BmwI3Battery::update_values() { //This function maps all the values fetched via CAN to the battery datalayer void BmwI3Battery::update_values() { //This function maps all the values fetched via CAN to the battery datalayer
if (datalayer.system.settings.equipment_stop_active == true) { if (datalayer.system.settings.equipment_stop_active == true) {
digitalWrite(wakeup_pin, LOW); // Turn off wakeup pin digitalWrite(wakeup_pin, LOW); // Turn off wakeup pin
} else { } else if (millis() > INTERVAL_1_S) {
digitalWrite(wakeup_pin, HIGH); // Wake up the battery digitalWrite(wakeup_pin, HIGH); // Wake up the battery
} }
@ -507,5 +507,5 @@ void BmwI3Battery::setup(void) { // Performs one time setup at startup
datalayer_battery->info.number_of_cells = NUMBER_OF_CELLS; datalayer_battery->info.number_of_cells = NUMBER_OF_CELLS;
pinMode(wakeup_pin, OUTPUT); pinMode(wakeup_pin, OUTPUT);
digitalWrite(wakeup_pin, HIGH); // Wake up the battery digitalWrite(wakeup_pin, LOW); // Set pin to low, prepare to wakeup later on!
} }