add buttons/rotary/ir/BT sink in sleep + battery low-voltage

This commit is contained in:
philippe44
2023-09-16 17:55:41 -07:00
parent f4c0a91e84
commit bb185d76dc
10 changed files with 199 additions and 71 deletions

View File

@@ -48,8 +48,8 @@ void ws2812_write_leds(struct led_state new_state);
static const char TAG[] = "muse";
static void (*battery_handler_chain)(float value);
static void battery_svc(float value);
static void (*battery_handler_chain)(float value, int cells);
static void battery_svc(float value, int cells);
static bool init(void);
static void set_battery_led(float value);
@@ -81,11 +81,11 @@ static void set_battery_led(float value) {
ws2812_write_leds(new_state);
}
static void battery_svc(float value) {
static void battery_svc(float value, int cells) {
set_battery_led(value);
ESP_LOGI(TAG, "Called for battery service with %f", value);
if (battery_handler_chain) battery_handler_chain(value);
if (battery_handler_chain) battery_handler_chain(value, cells);
}
// This is the buffer which the hw peripheral will access while pulsing the output pin