diff --git a/corrections.h b/corrections.h index 7149e383..fe5124b7 100644 --- a/corrections.h +++ b/corrections.h @@ -21,13 +21,13 @@ static inline byte correctionLaunch(); //Launch control correction static inline bool correctionDFCO(); //Decelleration fuel cutoff byte correctionsIgn(); -static inline byte correctionFixedTiming(byte); -static inline byte correctionCrankingFixedTiming(byte); -static inline byte correctionFlexTiming(byte); -static inline byte correctionIATretard(byte); -static inline byte correctionSoftRevLimit(byte); -static inline byte correctionSoftLaunch(byte); -static inline byte correctionSoftFlatShift(byte); +static inline int8_t correctionFixedTiming(int8_t); +static inline int8_t correctionCrankingFixedTiming(int8_t); +static inline int8_t correctionFlexTiming(int8_t); +static inline int8_t correctionIATretard(int8_t); +static inline int8_t correctionSoftRevLimit(int8_t); +static inline int8_t correctionSoftLaunch(int8_t); +static inline int8_t correctionSoftFlatShift(int8_t); #endif // CORRECTIONS_H diff --git a/corrections.ino b/corrections.ino index 2e496ad7..5f80a6b7 100644 --- a/corrections.ino +++ b/corrections.ino @@ -314,7 +314,7 @@ static inline byte correctionAFRClosedLoop() //******************************** IGNITION ADVANCE CORRECTIONS ******************************** -byte correctionsIgn(byte advance) +int8_t correctionsIgn(int8_t advance) { advance = correctionFlexTiming(advance); @@ -329,19 +329,19 @@ byte correctionsIgn(byte advance) return advance; } -static inline byte correctionFixedTiming(byte advance) +static inline int8_t correctionFixedTiming(int8_t advance) { if (configPage2.FixAng != 0) { return configPage2.FixAng; } //Check whether the user has set a fixed timing angle return advance; } -static inline byte correctionCrankingFixedTiming(byte advance) +static inline int8_t correctionCrankingFixedTiming(int8_t advance) { if ( BIT_CHECK(currentStatus.engine, BIT_ENGINE_CRANK) ) { return configPage2.CrankAng; } //Use the fixed cranking ignition angle return advance; } -static inline byte correctionFlexTiming(byte advance) +static inline int8_t correctionFlexTiming(int8_t advance) { if(!configPage1.flexEnabled) { return advance; } //Check for flex being enabled byte flexRange = configPage1.flexAdvHigh - configPage1.flexAdvLow; @@ -352,7 +352,7 @@ static inline byte correctionFlexTiming(byte advance) return advance + currentStatus.flexIgnCorrection; } -static inline byte correctionIATretard(byte advance) +static inline int8_t correctionIATretard(int8_t advance) { //Adjust the advance based on IAT. If the adjustment amount is greater than the current advance, just set advance to 0 byte advanceIATadjust = table2D_getValue(&IATRetardTable, currentStatus.IAT); @@ -360,14 +360,14 @@ static inline byte correctionIATretard(byte advance) else { return 0; } } -static inline byte correctionSoftRevLimit(byte advance) +static inline int8_t correctionSoftRevLimit(int8_t advance) { BIT_CLEAR(currentStatus.spark, BIT_SPARK_SFTLIM); if (currentStatus.RPM > ((unsigned int)(configPage2.SoftRevLim) * 100) ) { BIT_SET(currentStatus.spark, BIT_SPARK_SFTLIM); return configPage2.SoftLimRetard; } //Softcut RPM limit (If we're above softcut limit, delay timing by configured number of degrees) return advance; } -static inline byte correctionSoftLaunch(byte advance) +static inline int8_t correctionSoftLaunch(int8_t advance) { //SoftCut rev limit for 2-step launch control. if (configPage3.launchEnabled && clutchTrigger && (currentStatus.clutchEngagedRPM < ((unsigned int)(configPage3.flatSArm) * 100)) && (currentStatus.RPM > ((unsigned int)(configPage3.lnchSoftLim) * 100)) ) @@ -382,7 +382,7 @@ static inline byte correctionSoftLaunch(byte advance) return advance; } -static inline byte correctionSoftFlatShift(byte advance) +static inline int8_t correctionSoftFlatShift(int8_t advance) { if(configPage3.flatSEnable && clutchTrigger && (currentStatus.clutchEngagedRPM > ((unsigned int)(configPage3.flatSArm) * 100)) && (currentStatus.RPM > (currentStatus.clutchEngagedRPM-configPage3.flatSSoftWin) ) ) { diff --git a/globals.h b/globals.h index e6f5e85b..e2bb6e77 100644 --- a/globals.h +++ b/globals.h @@ -394,7 +394,7 @@ struct config3 { byte launchHiLo : 1; byte lnchSoftLim; - byte lnchRetard; + int8_t lnchRetard; //Allow for negative advance value (ATDC) byte lnchHardLim; byte lnchFuelAdd; diff --git a/reference/speeduino.ini b/reference/speeduino.ini index 798a7b5b..b0f2bfe1 100644 --- a/reference/speeduino.ini +++ b/reference/speeduino.ini @@ -360,7 +360,7 @@ page = 6 vvtPin = bits , U08, 13, [0:5], "Board Default", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "21", "22", "23", "24", "25", "26", "27", "28", "29", "30", "31", "32", "33", "34", "35", "36", "37", "38", "39", "40", "41", "42", "43", "44", "45", "46", "47", "48", "49", "50", "51", "52", "53", "54", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID" unused6-13e = bits, U08, 13, [6:6], "ONE", "INVALID" unused6-13f = bits, U08, 13, [7:7], "ONE", "INVALID" - boostPin = bits , U08, 14, [0:5], "Board Default", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "21", "22", "23", "24", "25", "26", "27", "28", "29", "30", "31", "32", "33", "34", "35", "36", "37", "38", "39", "40", "41", "42", "43", "44", "45", "46", "47", "48", "49", "50", "51", "52", "53", "54", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID" + boostPin = bits, U08, 14, [0:5], "Board Default", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "21", "22", "23", "24", "25", "26", "27", "28", "29", "30", "31", "32", "33", "34", "35", "36", "37", "38", "39", "40", "41", "42", "43", "44", "45", "46", "47", "48", "49", "50", "51", "52", "53", "54", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID" unused6-14e = bits, U08, 14, [6:6], "ONE", "INVALID" unused6-14f = bits, U08, 14, [7:7], "ONE", "INVALID" brvBins = array, U08, 15, [6], "V", 0.1, 0, 6, 24, 1 ; Bins for the battery reference voltage @@ -383,7 +383,7 @@ page = 6 launchHiLo = bits, U08, 48, [7:7], "LOW", "HIGH" lnchSoftLim = scalar, U08, 49, "rpm", 100, 0.0, 100, 25500, 0 - lnchRetard = scalar, U08, 50, "deg", 1.0, 0.0, 0.0, 80, 0 + lnchRetard = scalar, S08, 50, "deg", 1.0, 0.0, -30, 40, 0 lnchHardLim = scalar, U08, 51, "rpm", 100, 0.0, 100, 25500, 0 lnchFuelAdd = scalar, U08, 52, "%", 1.0, 0.0, 0.0, 80, 0 diff --git a/storage.ino b/storage.ino index 58966ea5..15b03862 100644 --- a/storage.ino +++ b/storage.ino @@ -316,7 +316,7 @@ void loadConfig() for(int x=EEPROM_CONFIG3_XBINS; x