Hal refactored (#99)

This commit is contained in:
Ken Van Hoeylandt
2024-12-02 00:32:39 +01:00
committed by GitHub
parent 0188ce721c
commit 33bb742dfb
103 changed files with 1222 additions and 1228 deletions
+31
View File
@@ -0,0 +1,31 @@
#include "hal/Power.h"
static bool is_charging_enabled = false;
static bool isCharging() {
return is_charging_enabled;
}
static bool isChargingEnabled() {
return is_charging_enabled;
}
static void setChargingEnabled(bool enabled) {
is_charging_enabled = enabled;
}
static uint8_t getChargeLevel() {
return 204;
}
static int32_t getCurrent() {
return is_charging_enabled ? 100 : -50;
}
extern const tt::hal::Power power = {
.isCharging = isCharging,
.isChargingEnabled = isChargingEnabled,
.setChargingEnabled = setChargingEnabled,
.getChargeLevel = getChargeLevel,
.getCurrent = getCurrent
};