diff --git a/Core/Src/slave_monitoring.c b/Core/Src/slave_monitoring.c index 6443f3c..e3811eb 100644 --- a/Core/Src/slave_monitoring.c +++ b/Core/Src/slave_monitoring.c @@ -87,9 +87,7 @@ void slaves_check() { min_voltage = min_voltage_new; max_temp = max_temp_new; - if (any_slave_error) { - ts_sm_set_error_source(TS_ERROR_SOURCE_SLAVES, 1); - } + ts_sm_set_error_source(TS_ERROR_SOURCE_SLAVES, any_slave_error); } void slaves_handle_panic(const uint8_t *data) { @@ -112,6 +110,7 @@ void slaves_handle_panic(const uint8_t *data) { } slaves[idx].error.data = ftcan_unmarshal_unsigned(&data, 4); slaves[idx].last_message = HAL_GetTick(); + ts_sm_set_error_source(TS_ERROR_SOURCE_SLAVES, 1); can_send_error(TS_ERRORKIND_SLAVE_PANIC, slave_id); }