diff --git a/speeduino/corrections.ino b/speeduino/corrections.ino index d005eec6..9c0eb275 100644 --- a/speeduino/corrections.ino +++ b/speeduino/corrections.ino @@ -287,8 +287,6 @@ uint16_t correctionAccel(void) int16_t accelValue = 100; int16_t MAP_change = 0; int16_t TPS_change = 0; - int16_t MAP_rateOfChange = 0; - int16_t TPS_rateOfChange = 0; if(configPage2.aeMode == AE_MODE_MAP) { diff --git a/speeduino/engineProtection.ino b/speeduino/engineProtection.ino index ee2f0807..6c9deb98 100644 --- a/speeduino/engineProtection.ino +++ b/speeduino/engineProtection.ino @@ -95,7 +95,6 @@ byte checkBoostLimit(void) byte checkOilPressureLimit(void) { byte oilProtectActive = 0; - static constexpr char X100_MULTIPLIER = 100; bool alreadyActive = BIT_CHECK(currentStatus.engineProtectStatus, ENGINE_PROTECT_BIT_OIL); BIT_CLEAR(currentStatus.engineProtectStatus, ENGINE_PROTECT_BIT_OIL); //Will be set true below if required diff --git a/test/test_fuel/test_corrections.cpp b/test/test_fuel/test_corrections.cpp index 186fa84f..db16e60d 100644 --- a/test/test_fuel/test_corrections.cpp +++ b/test/test_fuel/test_corrections.cpp @@ -229,7 +229,7 @@ void test_corrections_TAE_no_rpm_taper() uint16_t accelValue = correctionAccel(); //Run the AE calcs - TEST_ASSERT_EQUAL(75, currentStatus.tpsDOT); //DOT is 750%/s (25 * 30), value divided by 10; + TEST_ASSERT_EQUAL(750, currentStatus.tpsDOT); //DOT is 750%/s (25 * 30) TEST_ASSERT_EQUAL((100+132), accelValue); TEST_ASSERT_TRUE(BIT_CHECK(currentStatus.engine, BIT_ENGINE_ACC)); //Confirm AE is flagged on } @@ -246,7 +246,7 @@ void test_corrections_TAE_50pc_rpm_taper() uint16_t accelValue = correctionAccel(); //Run the AE calcs - TEST_ASSERT_EQUAL(75, currentStatus.tpsDOT); //DOT is 750%/s (25 * 30), value divided by 10; + TEST_ASSERT_EQUAL(750, currentStatus.tpsDOT); //DOT is 750%/s (25 * 30) TEST_ASSERT_EQUAL((100+66), accelValue); TEST_ASSERT_TRUE(BIT_CHECK(currentStatus.engine, BIT_ENGINE_ACC)); //Confirm AE is flagged on } @@ -263,7 +263,7 @@ void test_corrections_TAE_110pc_rpm_taper() uint16_t accelValue = correctionAccel(); //Run the AE calcs - TEST_ASSERT_EQUAL(75, currentStatus.tpsDOT); //DOT is 750%/s (25 * 30), value divided by 10; + TEST_ASSERT_EQUAL(750, currentStatus.tpsDOT); //DOT is 750%/s (25 * 30) TEST_ASSERT_EQUAL(100, accelValue); //Should be no AE as we're above the RPM taper end point TEST_ASSERT_TRUE(BIT_CHECK(currentStatus.engine, BIT_ENGINE_ACC)); //Confirm AE is flagged on } @@ -281,7 +281,7 @@ void test_corrections_TAE_under_threshold() uint16_t accelValue = correctionAccel(); //Run the AE calcs - TEST_ASSERT_EQUAL(9, currentStatus.tpsDOT); //DOT is 90%/s (3% * 30), value divided by 10; + TEST_ASSERT_EQUAL(90, currentStatus.tpsDOT); //DOT is 90%/s (3% * 30) TEST_ASSERT_EQUAL(100, accelValue); //Should be no AE as we're above the RPM taper end point TEST_ASSERT_FALSE(BIT_CHECK(currentStatus.engine, BIT_ENGINE_ACC)); //Confirm AE is flagged off } @@ -305,7 +305,7 @@ void test_corrections_TAE_50pc_warmup_taper() uint16_t accelValue = correctionAccel(); //Run the AE calcs - TEST_ASSERT_EQUAL(75, currentStatus.tpsDOT); //DOT is 750%/s (25 * 30), value divided by 10; + TEST_ASSERT_EQUAL(750, currentStatus.tpsDOT); //DOT is 750%/s (25 * 30) TEST_ASSERT_EQUAL((100+165), accelValue); //Total AE should be 132 + (50% * 50%) = 132 * 1.25 = 165 TEST_ASSERT_TRUE(BIT_CHECK(currentStatus.engine, BIT_ENGINE_ACC)); //Confirm AE is flagged on }