Check number of broken temperature sensors

This commit is contained in:
jazzpi
2022-07-30 22:23:05 +02:00
parent 4316e604da
commit e0b9568e56
3 changed files with 17 additions and 0 deletions

View File

@ -78,6 +78,20 @@ uint8_t checkSlaveTimeout() {
return 1;
}
}
int working_cell_temps = 0;
for (int i = 0; i < NUMBEROFTEMPS; i++) {
if (slaves[n].cellTemps[i] != 0) {
working_cell_temps++;
}
}
if (working_cell_temps < SLAVE_MIN_TEMP_SENSORS) {
AMSErrorHandle temperror;
temperror.errorcode = SLAVES_TOO_FEW_TEMPS;
temperror.errorarg[0] = n;
AMS_Error_Handler(&temperror);
return 1;
}
}
return 0;
}