diff --git a/rp2040_42/src/main.rs b/rp2040_42/src/main.rs index dfbe96a..2dc2d7e 100644 --- a/rp2040_42/src/main.rs +++ b/rp2040_42/src/main.rs @@ -161,8 +161,8 @@ fn main() -> ! { let mut status_led_count_down = timer.count_down(); status_led_count_down.start(250.millis()); - let mut start_count_down = timer.count_down(); - start_count_down.start(5000.millis()); + // let mut start_count_down = timer.count_down(); + // start_count_down.start(5000.millis()); // Create variables to track caps lock and fn mode let mut caps_lock_active: bool = false; @@ -192,18 +192,18 @@ fn main() -> ! { update_status_led(&mut status_led, &caps_lock_active, &sticky_state, &started); } - if start_count_down.wait().is_ok() && !started { - started = true; - } + // if start_count_down.wait().is_ok() && !started { + // started = true; + // } if usb_hid_report_count_down.wait().is_ok() { let pressed_keys = button_matrix.buttons_pressed(); fn_mode = get_fn_mode(pressed_keys); - if !caps_lock_active && sticky_state != 2 { - update_status_led(&mut status_led, &caps_lock_active, &sticky_state, &started); - } + // if !caps_lock_active && sticky_state != 2 { + // update_status_led(&mut status_led, &caps_lock_active, &sticky_state, &started); + // } for (index, key) in pressed_keys.iter().enumerate() { buttons[index].pressed = *key; @@ -245,6 +245,7 @@ fn main() -> ! { } Ok(leds) => { caps_lock_active = leds.caps_lock; + started = true; } } } @@ -265,7 +266,7 @@ fn update_status_led( status_led: &mut Ws2812StatusLed, caps_lock_active: &bool, sticky_state: &u8, - _started: &bool, + started: &bool, ) where P: PIOExt + FunctionConfig, I: PinId, @@ -278,6 +279,8 @@ fn update_status_led( status_led.update(StatusMode::Activity); } else if *sticky_state == 2 { status_led.update(StatusMode::ActivityFlash); + } else if !(*started) { + status_led.update(StatusMode::Warning); } else { status_led.update(StatusMode::Normal); }