From 50a8508b80b0788257bf509f1ca14661dead7716 Mon Sep 17 00:00:00 2001 From: rusefillc Date: Sun, 19 Jun 2022 11:29:17 -0400 Subject: [PATCH] Mark reports that detectHellenBoardType hangs up HD and Nucleo fix #4084 --- firmware/config/boards/hellen/hellen_board_id.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/firmware/config/boards/hellen/hellen_board_id.cpp b/firmware/config/boards/hellen/hellen_board_id.cpp index 6e755a08fc..e9b40315b9 100644 --- a/firmware/config/boards/hellen/hellen_board_id.cpp +++ b/firmware/config/boards/hellen/hellen_board_id.cpp @@ -97,7 +97,12 @@ float HellenBoardIdSolver::solve(float Tc1, float Tc2, float x0, float y, float float Xcur, Xnext; Xnext = x0; + int safetyLimit = 5000; // since we had https://github.com/rusefi/rusefi/issues/4084 let's add paranoia check do { + if (safetyLimit-- < 0) { + firmwareError(OBD_PCM_Processor_Fault, "hellen boardID is broken"); + return Xnext; + } Xcur = Xnext; Xnext = Xcur - fx(Xcur) / dfx(Xcur);