Merge pull request #41 from bpetrikovics/master

T1000E: blink LED on shutdown when buzzer is muted
This commit is contained in:
liquidraver
2026-07-01 22:24:59 +02:00
committed by GitHub
3 changed files with 36 additions and 0 deletions
+6
View File
@@ -503,6 +503,12 @@ static void action_deep_sleep(void)
k_sleep(K_MSEC(50));
}
buzzer_stop();
#ifdef CONFIG_BOARD_T1000_E
if (buzzer_is_quiet()) {
ui_led_flash_shutdown();
}
#endif
#endif
/* Shared peripheral teardown + SENSE config for sw0 wake.
+18
View File
@@ -212,6 +212,24 @@ void ui_led_flash_msg(void)
#endif
}
/* Flash the heartbeat LED 3 times on shutdown.
* Used as a visual power-off indicator when the buzzer is muted. */
void ui_led_flash_shutdown(void)
{
#if HAS_HEARTBEAT_LED
if (gpio_is_ready_dt(&s_heartbeat_led)) {
for (int i = 0; i < 3; i++) {
gpio_pin_set_dt(&s_heartbeat_led, 1);
k_sleep(K_MSEC(100));
gpio_pin_set_dt(&s_heartbeat_led, 0);
if (i < 2) {
k_sleep(K_MSEC(100));
}
}
}
#endif
}
/* ========== Battery refresh ==========
* Lazy: render path calls ui_refresh_battery(); ADC only fires when the
* cached reading is older than UI_BATT_REFRESH_MS. Telemetry / stats paths
+12
View File
@@ -164,6 +164,18 @@ void ui_set_leds_disabled(bool disabled);
*/
void ui_set_heartbeat_led(bool enabled);
/**
* Flash the heartbeat LED immediately on message receipt.
* Cancels the current cycle, pulses, then resumes normal heartbeat.
*/
void ui_led_flash_msg(void);
/**
* Flash the heartbeat LED 3 times as a visual shutdown indicator.
* Used when the buzzer is muted — gives visual feedback on power-off.
*/
void ui_led_flash_shutdown(void);
/**
* Set offgrid mode (client repeat) state for display page.
*/