Fix battery support ifdef guards
This commit is contained in:
parent
afc476ff32
commit
83fb65cd44
|
@ -93,6 +93,7 @@ void main(void)
|
||||||
}
|
}
|
||||||
|
|
||||||
do {
|
do {
|
||||||
|
#ifdef BATTERY_SUPPORTED
|
||||||
err = battery_update();
|
err = battery_update();
|
||||||
if (err) {
|
if (err) {
|
||||||
printk("Failed to update battery voltage: %d\n", err);
|
printk("Failed to update battery voltage: %d\n", err);
|
||||||
|
@ -102,11 +103,12 @@ void main(void)
|
||||||
snprintf(tmpstr, sizeof(tmpstr), "%04u mV", battery_get_voltage_mv());
|
snprintf(tmpstr, sizeof(tmpstr), "%04u mV", battery_get_voltage_mv());
|
||||||
platform_display_draw_string(0, DISPLAY_LINE_BATTERY_VOLTAGE + 1, tmpstr);
|
platform_display_draw_string(0, DISPLAY_LINE_BATTERY_VOLTAGE + 1, tmpstr);
|
||||||
|
|
||||||
#if defined(BATTERY_SUPPORTED) && defined(BATTERY_SOC_SUPPORTED)
|
#ifdef BATTERY_SOC_SUPPORTED
|
||||||
snprintf(tmpstr, sizeof(tmpstr), "%3u%%", battery_voltage_mv_to_soc(battery_get_voltage_mv()));
|
snprintf(tmpstr, sizeof(tmpstr), "%3u%%", battery_voltage_mv_to_soc(battery_get_voltage_mv()));
|
||||||
platform_display_draw_string(0, DISPLAY_LINE_BATTERY_VOLTAGE + 3, tmpstr);
|
platform_display_draw_string(0, DISPLAY_LINE_BATTERY_VOLTAGE + 3, tmpstr);
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
do_covid();
|
do_covid();
|
||||||
do_gatt();
|
do_gatt();
|
||||||
} while (1);
|
} while (1);
|
||||||
|
|
Loading…
Reference in New Issue