Check number of broken temperature sensors
This commit is contained in:
@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user