reset error count to 0
This commit is contained in:
parent
dd0f755ae0
commit
c7ce1fa8e8
@ -117,7 +117,7 @@ int main(void)
|
||||
int error_count = 0;
|
||||
while (1)
|
||||
{
|
||||
if (error_count > 10) {
|
||||
if (error_count > 25) {
|
||||
debug_log(LOG_LEVEL_ERROR, "Too many errors, restarting BMS...");
|
||||
status = AMS_Init(&hspi1);
|
||||
if (status.status != ADBMS_NO_ERROR) {
|
||||
@ -125,6 +125,7 @@ int main(void)
|
||||
HAL_Delay(2000);
|
||||
continue;
|
||||
}
|
||||
error_count = 0;
|
||||
}
|
||||
status = AMS_Idle_Loop();
|
||||
if (status.status != ADBMS_NO_ERROR) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user