From 8e4b8403252410a03066a74310b82e5c60ec5324 Mon Sep 17 00:00:00 2001 From: Jon Billings Date: Wed, 14 Dec 2022 01:03:53 +0000 Subject: [PATCH] stuck ego fix (#942) Ego control gets stuck at 100% when ignitionCount wraps during an DFCO event because the test "if (ignitionCount < AFRnextCycle).." continues to fail until ignitionCount catches up with AFRnextCycle again - long time. This fix also checks for ignitionCount < (AFRnextCycle - configPage6.egoCount) --- speeduino/corrections.ino | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/speeduino/corrections.ino b/speeduino/corrections.ino index bdaf0d3b..d005eec6 100644 --- a/speeduino/corrections.ino +++ b/speeduino/corrections.ino @@ -628,7 +628,7 @@ byte correctionAFRClosedLoop(void) { AFRValue = currentStatus.egoCorrection; //Need to record this here, just to make sure the correction stays 'on' even if the nextCycle count isn't ready - if(ignitionCount >= AFRnextCycle) + if((ignitionCount >= AFRnextCycle) || (ignitionCount < (AFRnextCycle - configPage6.egoCount))) { AFRnextCycle = ignitionCount + configPage6.egoCount; //Set the target ignition event for the next calculation