fix spurious errors during startup, maybe fix GPIO voltages

This commit is contained in:
Kilian Bracher 2025-03-25 21:40:24 +01:00
parent a3d02950b4
commit 56b0d1e7ed
2 changed files with 10 additions and 2 deletions

View File

@ -123,7 +123,7 @@ HAL_StatusTypeDef amsAuxAndStatusMeasurement(Cell_Module (*module)[N_BMS]) {
}
if (pollCMD(PLAUX) == HAL_BUSY) {
return HAL_BUSY;
//return HAL_BUSY;
}
CHECK_RETURN(

View File

@ -126,8 +126,14 @@ int main(void)
continue;
}
error_count = 0;
count = 0;
}
status = AMS_Idle_Loop();
if (count < 10) { // don't print errors for the first 10 loops while the BMS is starting up
count++;
HAL_Delay(100);
continue;
}
if (status.status != ADBMS_NO_ERROR) {
debug_log(LOG_LEVEL_ERROR, "AMS_Idle_Loop returned %u (%s) on BMS %d", status.status, ADBMS_Status_ToString(status.status), status.bms_id);
error_count++;
@ -250,7 +256,9 @@ int main(void)
/* USER CODE BEGIN 3 */
count++;
count &= 0b1111; // wrap around at 16
if (count > 16) {
count = 11; // keep count from overflowing
}
}
/* USER CODE END 3 */
}