Mark reports that detectHellenBoardType hangs up HD and Nucleo fix #4084

This commit is contained in:
rusefillc 2022-06-19 11:29:17 -04:00
parent ecc14de300
commit 50a8508b80
1 changed files with 5 additions and 0 deletions

View File

@ -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);