Improve BLE serial performance + add BLE battery display

This commit is contained in:
jacob.eva 2024-09-10 22:37:26 +01:00
parent c9fd5f7d3b
commit 7f787d5910
No known key found for this signature in database
GPG key ID: 0B92E083BBCCAA1E
4 changed files with 31 additions and 0 deletions

10
Power.h
View file

@ -273,6 +273,16 @@ void measure_battery() {
if (battery_percent >= 98) {
battery_state = BATTERY_STATE_CHARGED;
}
#if HAS_BLE
if ((bt_state == BT_STATE_ON) || bt_state == BT_STATE_CONNECTED) {
if (battery_state != BATTERY_STATE_CHARGING) {
blebas.write(battery_percent);
} else {
blebas.write(100);
}
}
#endif
#endif
if (battery_ready) {