Send AMS error messages

This commit is contained in:
2023-04-30 00:57:42 +02:00
parent 48ae56fbdf
commit ce4d7253eb
6 changed files with 34 additions and 1 deletions

View File

@ -23,7 +23,14 @@ void shunt_init() {
}
void shunt_check() {
int is_error = shunt_data.current >= THRESH_OVERCURRENT;
int is_error = 0;
if (shunt_data.current >= THRESH_OVERCURRENT) {
is_error = 1;
can_send_error(TS_ERRORKIND_SHUNT_OVERTEMP, 0);
} else if (shunt_data.busbartemp >= THRESH_OVERTEMP) {
is_error = 1;
can_send_error(TS_ERRORKIND_SHUNT_OVERTEMP, 0);
}
ts_sm_set_error_source(TS_ERROR_SOURCE_SHUNT, is_error);
}