Add power enabled check to power API (#68)

This commit is contained in:
Ken Van Hoeylandt
2024-11-03 22:30:41 +01:00
committed by GitHub
parent 632d7ccccf
commit 28c456e2d9
4 changed files with 27 additions and 2 deletions
+5
View File
@@ -10,6 +10,10 @@ static bool power_is_charging() {
return is_charging_enabled;
}
static bool power_is_charging_enabled() {
return is_charging_enabled;
}
static void power_set_charging_enabled(bool enabled) {
is_charging_enabled = enabled;
}
@@ -24,6 +28,7 @@ static int32_t power_get_current() {
const Power power = {
.is_charging = &power_is_charging,
.is_charging_enabled = &power_is_charging_enabled,
.set_charging_enabled = &power_set_charging_enabled,
.get_charge_level = &power_get_charge_level,
.get_current = &power_get_current