mirror of
https://github.com/markqvist/RNode_Firmware.git
synced 2025-06-29 00:47:19 -04:00
Update battery status output on missing battery
This commit is contained in:
parent
2804a05afd
commit
5bd2e539eb
2 changed files with 7 additions and 6 deletions
11
Config.h
11
Config.h
|
@ -169,9 +169,10 @@
|
|||
const uint8_t RX_ONGOING = 0x04;
|
||||
|
||||
// Power management
|
||||
#define BATTERY_STATE_UNKNOWN 0x00
|
||||
#define BATTERY_STATE_DISCHARGING 0x01
|
||||
#define BATTERY_STATE_CHARGING 0x02
|
||||
#define BATTERY_STATE_CHARGED 0x03
|
||||
#define BATTERY_STATE_CHARGING 0x02
|
||||
#define BATTERY_STATE_CHARGED 0x03
|
||||
bool battery_installed = false;
|
||||
bool battery_indeterminate = false;
|
||||
bool external_power = false;
|
||||
|
@ -189,8 +190,8 @@
|
|||
|
||||
// Boot flags
|
||||
#define START_FROM_BOOTLOADER 0x01
|
||||
#define START_FROM_POWERON 0x02
|
||||
#define START_FROM_BROWNOUT 0x03
|
||||
#define START_FROM_JTAG 0x04
|
||||
#define START_FROM_POWERON 0x02
|
||||
#define START_FROM_BROWNOUT 0x03
|
||||
#define START_FROM_JTAG 0x04
|
||||
|
||||
#endif
|
||||
|
|
2
Power.h
2
Power.h
|
@ -190,7 +190,7 @@ void measure_battery() {
|
|||
}
|
||||
}
|
||||
} else {
|
||||
battery_state = BATTERY_STATE_DISCHARGING;
|
||||
battery_state = BATTERY_STATE_UNKNOWN;
|
||||
battery_percent = 0.0;
|
||||
battery_voltage = 0.0;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue