From 9843a79a86f2e7b9e1e7b5a8d83ccf0bf5e34db0 Mon Sep 17 00:00:00 2001 From: Mateusz Faderewski Date: Mon, 20 May 2024 16:18:14 +0200 Subject: [PATCH] [SC64][SW] controller: fixed stuck LED state when error was cleared --- sw/controller/src/led.c | 23 ++++++++--------------- 1 file changed, 8 insertions(+), 15 deletions(-) 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;