From 019906fd908de33076a1e839319b1317ac0687ab Mon Sep 17 00:00:00 2001 From: Josh Stewart Date: Fri, 30 Aug 2019 21:19:44 +1000 Subject: [PATCH] Don't allow flat shift to go active if launch control is already active --- speeduino/speeduino.ino | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/speeduino/speeduino.ino b/speeduino/speeduino.ino index b7450aaa..d73d26f6 100644 --- a/speeduino/speeduino.ino +++ b/speeduino/speeduino.ino @@ -154,10 +154,18 @@ void loop() currentStatus.launchingHard = true; BIT_SET(currentStatus.spark, BIT_SPARK_HLAUNCH); } - else { currentStatus.launchingHard = false; BIT_CLEAR(currentStatus.spark, BIT_SPARK_HLAUNCH); } + else + { + //FLag launch as being off + currentStatus.launchingHard = false; + BIT_CLEAR(currentStatus.spark, BIT_SPARK_HLAUNCH); + + //If launch is not active, check whether flat shift should be active + if(configPage6.flatSEnable && clutchTrigger && (currentStatus.RPM > ((unsigned int)(configPage6.flatSArm) * 100)) && (currentStatus.RPM > currentStatus.clutchEngagedRPM) ) { currentStatus.flatShiftingHard = true; } + else { currentStatus.flatShiftingHard = false; } + } + - if(configPage6.flatSEnable && clutchTrigger && (currentStatus.RPM > ((unsigned int)(configPage6.flatSArm) * 100)) && (currentStatus.RPM > currentStatus.clutchEngagedRPM) ) { currentStatus.flatShiftingHard = true; } - else { currentStatus.flatShiftingHard = false; } //Boost cutoff is very similar to launchControl, but with a check against MAP rather than a switch if( (configPage6.boostCutType > 0) && (currentStatus.MAP > (configPage6.boostLimit * 2)) ) //The boost limit is divided by 2 to allow a limit up to 511kPa