Update battery status output on missing battery

This commit is contained in:
Mark Qvist 2024-10-01 18:07:10 +02:00
parent 2804a05afd
commit 5bd2e539eb
2 changed files with 7 additions and 6 deletions

View file

@ -169,6 +169,7 @@
const uint8_t RX_ONGOING = 0x04; const uint8_t RX_ONGOING = 0x04;
// Power management // Power management
#define BATTERY_STATE_UNKNOWN 0x00
#define BATTERY_STATE_DISCHARGING 0x01 #define BATTERY_STATE_DISCHARGING 0x01
#define BATTERY_STATE_CHARGING 0x02 #define BATTERY_STATE_CHARGING 0x02
#define BATTERY_STATE_CHARGED 0x03 #define BATTERY_STATE_CHARGED 0x03

View file

@ -190,7 +190,7 @@ void measure_battery() {
} }
} }
} else { } else {
battery_state = BATTERY_STATE_DISCHARGING; battery_state = BATTERY_STATE_UNKNOWN;
battery_percent = 0.0; battery_percent = 0.0;
battery_voltage = 0.0; battery_voltage = 0.0;
} }