diff --git a/sw/controller/src/led.c b/sw/controller/src/led.c index 5122d8b..68a7b09 100644 --- a/sw/controller/src/led.c +++ b/sw/controller/src/led.c @@ -56,10 +56,7 @@ void led_blink_error (led_error_t error) { break; } - error_active = ( - cic_error | - rtc_error - ); + error_active = true; } void led_clear_error (led_error_t error) { @@ -72,17 +69,6 @@ void led_clear_error (led_error_t error) { rtc_error = false; break; } - - error_active = ( - cic_error | - rtc_error - ); - - if (!error_active) { - activity_pulse = false; - activity_pulse_timer = 0; - error_timer = 0; - } } @@ -105,6 +91,13 @@ void led_process (void) { blinks = CIC_ERROR_BLINKS; } else if (rtc_error) { blinks = RTC_ERROR_BLINKS; + } else { + activity_pulse = false; + activity_pulse_timer = 0; + error_active = false; + error_timer = 0; + hw_gpio_reset(GPIO_ID_LED); + return; } bool led_on = false;