File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed
Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -118,6 +118,7 @@ static void tick_handler(void) {
118118 static uint32_t controls_allowed_countdown = 0 ;
119119 static uint8_t prev_harness_status = HARNESS_STATUS_NC ;
120120 static uint8_t loop_counter = 0U ;
121+ static bool relay_malfunction_prev = false;
121122
122123 if (TICK_TIMER -> SR != 0U ) {
123124
@@ -130,6 +131,15 @@ static void tick_handler(void) {
130131 simple_watchdog_kick ();
131132 sound_tick ();
132133
134+ if (relay_malfunction_prev != relay_malfunction ) {
135+ if (relay_malfunction ) {
136+ fault_occurred (FAULT_RELAY_MALFUNCTION );
137+ } else {
138+ fault_recovered (FAULT_RELAY_MALFUNCTION );
139+ }
140+ }
141+ relay_malfunction_prev = relay_malfunction ;
142+
133143 // re-init everything that uses harness status
134144 if (harness .status != prev_harness_status ) {
135145 prev_harness_status = harness .status ;
You can’t perform that action at this time.
0 commit comments