From c7ce1fa8e856bc979574d8bc9987a6f5f22095df Mon Sep 17 00:00:00 2001 From: kbracher Date: Sun, 23 Mar 2025 16:43:48 +0100 Subject: [PATCH] reset error count to 0 --- AMS_Master_Code/Core/Src/main.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/AMS_Master_Code/Core/Src/main.c b/AMS_Master_Code/Core/Src/main.c index 467ae95..28c8af4 100644 --- a/AMS_Master_Code/Core/Src/main.c +++ b/AMS_Master_Code/Core/Src/main.c @@ -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) {