From 8eafb09c5d819657a98a445a0173f07589c7046d Mon Sep 17 00:00:00 2001 From: Aarav Garg Date: Wed, 5 Nov 2025 20:42:03 -0800 Subject: [PATCH] new experience on charging --- omi/firmware/omi/src/main.c | 58 +++++++++++++++++++++++++------------ 1 file changed, 40 insertions(+), 18 deletions(-) diff --git a/omi/firmware/omi/src/main.c b/omi/firmware/omi/src/main.c index 575ddb0e15..4629c309ef 100644 --- a/omi/firmware/omi/src/main.c +++ b/omi/firmware/omi/src/main.c @@ -87,31 +87,53 @@ static void boot_ready_sequence(void) void set_led_state() { + static bool charge_blink_state = false; + // Set LED state based on connection and charging status if (is_charging) { - set_led_green(true); + // When charging, alternate blink between green and connection status color + charge_blink_state = !charge_blink_state; + + if (charge_blink_state) { + // Green phase + set_led_green(true); + set_led_red(false); + set_led_blue(false); + } else { + // Connection status color phase + set_led_green(false); + if (is_connected) { + set_led_blue(true); + set_led_red(false); + } else { + set_led_red(true); + set_led_blue(false); + } + } } else { + // Not charging - reset blink state and turn off green + charge_blink_state = false; set_led_green(false); - } - // If device is off, turn off all status LEDs except charging indicator - if (is_off) { - set_led_red(false); - set_led_blue(false); - return; - } + // If device is off, turn off all status LEDs + if (is_off) { + set_led_red(false); + set_led_blue(false); + return; + } - if (is_connected) { - set_led_blue(true); - set_led_red(false); - return; - } + if (is_connected) { + set_led_blue(true); + set_led_red(false); + return; + } - // Not connected - RED - if (!is_connected) { - set_led_red(true); - set_led_blue(false); - return; + // Not connected - RED + if (!is_connected) { + set_led_red(true); + set_led_blue(false); + return; + } } }