Fix slave error source

This commit is contained in:
Jasper Blanckenburg 2023-05-03 17:13:10 +02:00
parent ce4d7253eb
commit c54f3a65e3
1 changed files with 2 additions and 3 deletions

View File

@ -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);
}