Introduce tests for the setEndTooth function in missing tooth
This commit is contained in:
parent
dac19a9ed1
commit
349d03249d
|
@ -191,11 +191,10 @@ extern unsigned long lastCrankAngleCalc;
|
||||||
extern int16_t lastToothCalcAdvance; //Invalid value here forces calculation of this on first main loop
|
extern int16_t lastToothCalcAdvance; //Invalid value here forces calculation of this on first main loop
|
||||||
extern unsigned long lastVVTtime; //The time between the vvt reference pulse and the last crank pulse
|
extern unsigned long lastVVTtime; //The time between the vvt reference pulse and the last crank pulse
|
||||||
|
|
||||||
//These must be signed as they can go to negative during calculation
|
extern uint16_t ignition1EndTooth;
|
||||||
extern int16_t ignition1EndTooth;
|
extern uint16_t ignition2EndTooth;
|
||||||
extern int16_t ignition2EndTooth;
|
extern uint16_t ignition3EndTooth;
|
||||||
extern int16_t ignition3EndTooth;
|
extern uint16_t ignition4EndTooth;
|
||||||
extern int16_t ignition4EndTooth;
|
|
||||||
|
|
||||||
extern int16_t toothAngles[24]; //An array for storing fixed tooth angles. Currently sized at 24 for the GM 24X decoder, but may grow later if there are other decoders that use this style
|
extern int16_t toothAngles[24]; //An array for storing fixed tooth angles. Currently sized at 24 for the GM 24X decoder, but may grow later if there are other decoders that use this style
|
||||||
|
|
||||||
|
|
|
@ -78,10 +78,10 @@ unsigned long lastCrankAngleCalc;
|
||||||
int16_t lastToothCalcAdvance = 99; //Invalid value here forces calculation of this on first main loop
|
int16_t lastToothCalcAdvance = 99; //Invalid value here forces calculation of this on first main loop
|
||||||
unsigned long lastVVTtime; //The time between the vvt reference pulse and the last crank pulse
|
unsigned long lastVVTtime; //The time between the vvt reference pulse and the last crank pulse
|
||||||
|
|
||||||
int16_t ignition1EndTooth = 0;
|
uint16_t ignition1EndTooth = 0;
|
||||||
int16_t ignition2EndTooth = 0;
|
uint16_t ignition2EndTooth = 0;
|
||||||
int16_t ignition3EndTooth = 0;
|
uint16_t ignition3EndTooth = 0;
|
||||||
int16_t ignition4EndTooth = 0;
|
uint16_t ignition4EndTooth = 0;
|
||||||
|
|
||||||
int16_t toothAngles[24]; //An array for storing fixed tooth angles. Currently sized at 24 for the GM 24X decoder, but may grow later if there are other decoders that use this style
|
int16_t toothAngles[24]; //An array for storing fixed tooth angles. Currently sized at 24 for the GM 24X decoder, but may grow later if there are other decoders that use this style
|
||||||
|
|
||||||
|
@ -535,25 +535,35 @@ void triggerSetEndTeeth_missingTooth()
|
||||||
byte toothAdder = 0;
|
byte toothAdder = 0;
|
||||||
if( (configPage4.sparkMode == IGN_MODE_SEQUENTIAL) && (configPage4.TrigSpeed == CRANK_SPEED) ) { toothAdder = configPage4.triggerTeeth; }
|
if( (configPage4.sparkMode == IGN_MODE_SEQUENTIAL) && (configPage4.TrigSpeed == CRANK_SPEED) ) { toothAdder = configPage4.triggerTeeth; }
|
||||||
|
|
||||||
ignition1EndTooth = ( (ignition1EndAngle - configPage4.triggerAngle) / (int16_t)(triggerToothAngle) ) - 1;
|
//Temp variables are used here to avoid potential issues if a trigger interrupt occurs part way through this function
|
||||||
if(ignition1EndTooth > (configPage4.triggerTeeth + toothAdder)) { ignition1EndTooth -= (configPage4.triggerTeeth + toothAdder); }
|
|
||||||
if(ignition1EndTooth <= 0) { ignition1EndTooth += (configPage4.triggerTeeth + toothAdder); }
|
|
||||||
if(ignition1EndTooth > (triggerActualTeeth + toothAdder)) { ignition1EndTooth = (triggerActualTeeth + toothAdder); }
|
|
||||||
|
|
||||||
ignition2EndTooth = ( (ignition2EndAngle - configPage4.triggerAngle) / (int16_t)(triggerToothAngle) ) - 1;
|
int16_t tempIgnition1EndTooth;
|
||||||
if(ignition2EndTooth > (configPage4.triggerTeeth + toothAdder)) { ignition2EndTooth -= (configPage4.triggerTeeth + toothAdder); }
|
tempIgnition1EndTooth = ( (ignition1EndAngle - configPage4.triggerAngle) / (int16_t)(triggerToothAngle) ) - 1;
|
||||||
if(ignition2EndTooth <= 0) { ignition2EndTooth += (configPage4.triggerTeeth + toothAdder); }
|
if(tempIgnition1EndTooth > (configPage4.triggerTeeth + toothAdder)) { tempIgnition1EndTooth -= (configPage4.triggerTeeth + toothAdder); }
|
||||||
if(ignition2EndTooth > (triggerActualTeeth + toothAdder)) { ignition2EndTooth = (triggerActualTeeth + toothAdder); }
|
if(tempIgnition1EndTooth <= 0) { tempIgnition1EndTooth += (configPage4.triggerTeeth + toothAdder); }
|
||||||
|
if((uint16_t)tempIgnition1EndTooth > (triggerActualTeeth + toothAdder)) { tempIgnition1EndTooth = (triggerActualTeeth + toothAdder); }
|
||||||
|
ignition1EndTooth = tempIgnition1EndTooth;
|
||||||
|
|
||||||
ignition3EndTooth = ( (ignition3EndAngle - configPage4.triggerAngle) / (int16_t)(triggerToothAngle) ) - 1;
|
int16_t tempIgnition2EndTooth;
|
||||||
if(ignition3EndTooth > (configPage4.triggerTeeth + toothAdder)) { ignition3EndTooth -= (configPage4.triggerTeeth + toothAdder); }
|
tempIgnition2EndTooth = ( (ignition2EndAngle - configPage4.triggerAngle) / (int16_t)(triggerToothAngle) ) - 1;
|
||||||
if(ignition3EndTooth <= 0) { ignition3EndTooth += (configPage4.triggerTeeth + toothAdder); }
|
if(tempIgnition2EndTooth > (configPage4.triggerTeeth + toothAdder)) { tempIgnition2EndTooth -= (configPage4.triggerTeeth + toothAdder); }
|
||||||
if(ignition3EndTooth > (triggerActualTeeth + toothAdder)) { ignition3EndTooth = (triggerActualTeeth + toothAdder); }
|
if(tempIgnition2EndTooth <= 0) { tempIgnition2EndTooth += (configPage4.triggerTeeth + toothAdder); }
|
||||||
|
if((uint16_t)tempIgnition2EndTooth > (triggerActualTeeth + toothAdder)) { tempIgnition2EndTooth = (triggerActualTeeth + toothAdder); }
|
||||||
|
ignition2EndTooth = tempIgnition2EndTooth;
|
||||||
|
|
||||||
ignition4EndTooth = ( (ignition4EndAngle - configPage4.triggerAngle) / (int16_t)(triggerToothAngle) ) - 1;
|
int16_t tempIgnition3EndTooth;
|
||||||
if(ignition4EndTooth > (configPage4.triggerTeeth + toothAdder)) { ignition4EndTooth -= (configPage4.triggerTeeth + toothAdder); }
|
tempIgnition3EndTooth = ( (ignition3EndAngle - configPage4.triggerAngle) / (int16_t)(triggerToothAngle) ) - 1;
|
||||||
if(ignition4EndTooth <= 0) { ignition4EndTooth += (configPage4.triggerTeeth + toothAdder); }
|
if(tempIgnition3EndTooth > (configPage4.triggerTeeth + toothAdder)) { tempIgnition3EndTooth -= (configPage4.triggerTeeth + toothAdder); }
|
||||||
if(ignition4EndTooth > (triggerActualTeeth + toothAdder)) { ignition4EndTooth = (triggerActualTeeth + toothAdder); }
|
if(tempIgnition3EndTooth <= 0) { tempIgnition3EndTooth += (configPage4.triggerTeeth + toothAdder); }
|
||||||
|
if((uint16_t)tempIgnition3EndTooth > (triggerActualTeeth + toothAdder)) { tempIgnition3EndTooth = (triggerActualTeeth + toothAdder); }
|
||||||
|
ignition3EndTooth = tempIgnition3EndTooth;
|
||||||
|
|
||||||
|
int16_t tempIgnition4EndTooth;
|
||||||
|
tempIgnition4EndTooth = ( (ignition4EndAngle - configPage4.triggerAngle) / (int16_t)(triggerToothAngle) ) - 1;
|
||||||
|
if(tempIgnition4EndTooth > (configPage4.triggerTeeth + toothAdder)) { tempIgnition4EndTooth -= (configPage4.triggerTeeth + toothAdder); }
|
||||||
|
if(tempIgnition4EndTooth <= 0) { tempIgnition4EndTooth += (configPage4.triggerTeeth + toothAdder); }
|
||||||
|
if((uint16_t)tempIgnition4EndTooth > (triggerActualTeeth + toothAdder)) { tempIgnition4EndTooth = (triggerActualTeeth + toothAdder); }
|
||||||
|
ignition4EndTooth = tempIgnition4EndTooth;
|
||||||
|
|
||||||
lastToothCalcAdvance = currentStatus.advance;
|
lastToothCalcAdvance = currentStatus.advance;
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,18 +15,320 @@ void test_setup_36_1()
|
||||||
triggerSetup_missingTooth();
|
triggerSetup_missingTooth();
|
||||||
}
|
}
|
||||||
|
|
||||||
void test_missingtooth_newIgn_1()
|
void test_setup_60_2()
|
||||||
{
|
{
|
||||||
|
//Setup a 60-2 wheel
|
||||||
|
configPage4.triggerTeeth = 60;
|
||||||
|
configPage4.triggerMissingTeeth = 2;
|
||||||
|
configPage4.TrigSpeed = CRANK_SPEED;
|
||||||
|
configPage4.trigPatternSec = SEC_TRIGGER_SINGLE;
|
||||||
|
|
||||||
|
triggerSetup_missingTooth();
|
||||||
|
}
|
||||||
|
|
||||||
|
//************************************** Begin the new ignition setEndTooth tests **************************************
|
||||||
|
void test_missingtooth_newIgn_36_1_trig0_1()
|
||||||
|
{
|
||||||
|
//Test the set end tooth function. Conditions:
|
||||||
|
//Trigger: 36-1
|
||||||
|
//Advance: 10
|
||||||
|
//triggerAngle=0
|
||||||
test_setup_36_1();
|
test_setup_36_1();
|
||||||
configPage4.sparkMode = IGN_MODE_WASTED;
|
configPage4.sparkMode = IGN_MODE_WASTED;
|
||||||
ignition1EndAngle = 350; //Set 10 degrees advance
|
ignition1EndAngle = 360 - 10; //Set 10 degrees advance
|
||||||
configPage4.triggerAngle = 0; //No trigger offset
|
configPage4.triggerAngle = 0; //No trigger offset
|
||||||
|
|
||||||
triggerSetEndTeeth_missingTooth();
|
triggerSetEndTeeth_missingTooth();
|
||||||
TEST_ASSERT_EQUAL(ignition1EndTooth, 34);
|
TEST_ASSERT_EQUAL(34, ignition1EndTooth);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void test_missingtooth_newIgn_36_1_trig90_1()
|
||||||
|
{
|
||||||
|
//Test the set end tooth function. Conditions:
|
||||||
|
//Trigger: 36-1
|
||||||
|
//Advance: 10
|
||||||
|
//triggerAngle=90
|
||||||
|
test_setup_36_1();
|
||||||
|
configPage4.sparkMode = IGN_MODE_WASTED;
|
||||||
|
ignition1EndAngle = 360 - 10; //Set 10 degrees advance
|
||||||
|
configPage4.triggerAngle = 90; //No trigger offset
|
||||||
|
|
||||||
|
triggerSetEndTeeth_missingTooth();
|
||||||
|
TEST_ASSERT_EQUAL(25, ignition1EndTooth);
|
||||||
|
}
|
||||||
|
|
||||||
|
void test_missingtooth_newIgn_36_1_trig180_1()
|
||||||
|
{
|
||||||
|
//Test the set end tooth function. Conditions:
|
||||||
|
//Trigger: 36-1
|
||||||
|
//Advance: 10
|
||||||
|
//triggerAngle=180
|
||||||
|
test_setup_36_1();
|
||||||
|
configPage4.sparkMode = IGN_MODE_WASTED;
|
||||||
|
ignition1EndAngle = 360 - 10; //Set 10 degrees advance
|
||||||
|
configPage4.triggerAngle = 180; //No trigger offset
|
||||||
|
|
||||||
|
triggerSetEndTeeth_missingTooth();
|
||||||
|
TEST_ASSERT_EQUAL(16, ignition1EndTooth);
|
||||||
|
}
|
||||||
|
|
||||||
|
void test_missingtooth_newIgn_36_1_trig270_1()
|
||||||
|
{
|
||||||
|
//Test the set end tooth function. Conditions:
|
||||||
|
//Trigger: 36-1
|
||||||
|
//Advance: 10
|
||||||
|
//triggerAngle=270
|
||||||
|
test_setup_36_1();
|
||||||
|
configPage4.sparkMode = IGN_MODE_WASTED;
|
||||||
|
ignition1EndAngle = 360 - 10; //Set 10 degrees advance
|
||||||
|
configPage4.triggerAngle = 270; //No trigger offset
|
||||||
|
|
||||||
|
triggerSetEndTeeth_missingTooth();
|
||||||
|
TEST_ASSERT_EQUAL(7, ignition1EndTooth);
|
||||||
|
}
|
||||||
|
|
||||||
|
void test_missingtooth_newIgn_36_1_trig360_1()
|
||||||
|
{
|
||||||
|
//Test the set end tooth function. Conditions:
|
||||||
|
//Trigger: 36-1
|
||||||
|
//Advance: 10
|
||||||
|
//triggerAngle=360
|
||||||
|
test_setup_36_1();
|
||||||
|
configPage4.sparkMode = IGN_MODE_WASTED;
|
||||||
|
ignition1EndAngle = 360 - 10; //Set 10 degrees advance
|
||||||
|
configPage4.triggerAngle = 360; //No trigger offset
|
||||||
|
|
||||||
|
triggerSetEndTeeth_missingTooth();
|
||||||
|
TEST_ASSERT_EQUAL(34, ignition1EndTooth);
|
||||||
|
}
|
||||||
|
|
||||||
|
void test_missingtooth_newIgn_36_1_trigNeg90_1()
|
||||||
|
{
|
||||||
|
//Test the set end tooth function. Conditions:
|
||||||
|
//Trigger: 36-1
|
||||||
|
//Advance: 10
|
||||||
|
//triggerAngle=-90
|
||||||
|
test_setup_36_1();
|
||||||
|
configPage4.sparkMode = IGN_MODE_WASTED;
|
||||||
|
ignition1EndAngle = 360 - 10; //Set 10 degrees advance
|
||||||
|
configPage4.triggerAngle = -90; //No trigger offset
|
||||||
|
|
||||||
|
triggerSetEndTeeth_missingTooth();
|
||||||
|
TEST_ASSERT_EQUAL(7, ignition1EndTooth);
|
||||||
|
}
|
||||||
|
|
||||||
|
void test_missingtooth_newIgn_36_1_trigNeg180_1()
|
||||||
|
{
|
||||||
|
//Test the set end tooth function. Conditions:
|
||||||
|
//Trigger: 36-1
|
||||||
|
//Advance: 10
|
||||||
|
//triggerAngle=-180
|
||||||
|
test_setup_36_1();
|
||||||
|
configPage4.sparkMode = IGN_MODE_WASTED;
|
||||||
|
ignition1EndAngle = 360 - 10; //Set 10 degrees advance
|
||||||
|
configPage4.triggerAngle = -180; //No trigger offset
|
||||||
|
|
||||||
|
triggerSetEndTeeth_missingTooth();
|
||||||
|
TEST_ASSERT_EQUAL(16, ignition1EndTooth);
|
||||||
|
}
|
||||||
|
|
||||||
|
void test_missingtooth_newIgn_36_1_trigNeg270_1()
|
||||||
|
{
|
||||||
|
//Test the set end tooth function. Conditions:
|
||||||
|
//Trigger: 36-1
|
||||||
|
//Advance: 10
|
||||||
|
//triggerAngle=-270
|
||||||
|
test_setup_36_1();
|
||||||
|
configPage4.sparkMode = IGN_MODE_WASTED;
|
||||||
|
ignition1EndAngle = 360 - 10; //Set 10 degrees advance
|
||||||
|
configPage4.triggerAngle = -270; //No trigger offset
|
||||||
|
|
||||||
|
triggerSetEndTeeth_missingTooth();
|
||||||
|
TEST_ASSERT_EQUAL(25, ignition1EndTooth);
|
||||||
|
}
|
||||||
|
|
||||||
|
void test_missingtooth_newIgn_36_1_trigNeg360_1()
|
||||||
|
{
|
||||||
|
//Test the set end tooth function. Conditions:
|
||||||
|
//Trigger: 36-1
|
||||||
|
//Advance: 10
|
||||||
|
//triggerAngle=-360
|
||||||
|
test_setup_36_1();
|
||||||
|
configPage4.sparkMode = IGN_MODE_WASTED;
|
||||||
|
ignition1EndAngle = 360 - 10; //Set 10 degrees advance
|
||||||
|
configPage4.triggerAngle = -360; //No trigger offset
|
||||||
|
|
||||||
|
triggerSetEndTeeth_missingTooth();
|
||||||
|
TEST_ASSERT_EQUAL(34, ignition1EndTooth);
|
||||||
|
}
|
||||||
|
|
||||||
|
// ******* CHannel 2 *******
|
||||||
|
void test_missingtooth_newIgn_36_1_trig0_2()
|
||||||
|
{
|
||||||
|
//Test the set end tooth function. Conditions:
|
||||||
|
//Trigger: 36-1
|
||||||
|
//Advance: 10
|
||||||
|
//triggerAngle=0
|
||||||
|
test_setup_36_1();
|
||||||
|
configPage4.sparkMode = IGN_MODE_WASTED;
|
||||||
|
ignition2EndAngle = 180 - 10; //Set 10 degrees advance
|
||||||
|
configPage4.triggerAngle = 0; //No trigger offset
|
||||||
|
|
||||||
|
triggerSetEndTeeth_missingTooth();
|
||||||
|
TEST_ASSERT_EQUAL(16, ignition2EndTooth);
|
||||||
|
}
|
||||||
|
|
||||||
|
void test_missingtooth_newIgn_36_1_trig90_2()
|
||||||
|
{
|
||||||
|
//Test the set end tooth function. Conditions:
|
||||||
|
//Trigger: 36-1
|
||||||
|
//Advance: 10
|
||||||
|
//triggerAngle=90
|
||||||
|
test_setup_36_1();
|
||||||
|
configPage4.sparkMode = IGN_MODE_WASTED;
|
||||||
|
ignition2EndAngle = 180 - 10; //Set 10 degrees advance
|
||||||
|
configPage4.triggerAngle = 90; //No trigger offset
|
||||||
|
|
||||||
|
triggerSetEndTeeth_missingTooth();
|
||||||
|
TEST_ASSERT_EQUAL(7, ignition2EndTooth);
|
||||||
|
}
|
||||||
|
|
||||||
|
void test_missingtooth_newIgn_36_1_trig180_2()
|
||||||
|
{
|
||||||
|
//Test the set end tooth function. Conditions:
|
||||||
|
//Trigger: 36-1
|
||||||
|
//Advance: 10
|
||||||
|
//triggerAngle=180
|
||||||
|
test_setup_36_1();
|
||||||
|
configPage4.sparkMode = IGN_MODE_WASTED;
|
||||||
|
ignition2EndAngle = 180 - 10; //Set 10 degrees advance
|
||||||
|
configPage4.triggerAngle = 180; //No trigger offset
|
||||||
|
|
||||||
|
triggerSetEndTeeth_missingTooth();
|
||||||
|
TEST_ASSERT_EQUAL(34, ignition2EndTooth);
|
||||||
|
}
|
||||||
|
|
||||||
|
void test_missingtooth_newIgn_36_1_trig270_2()
|
||||||
|
{
|
||||||
|
//Test the set end tooth function. Conditions:
|
||||||
|
//Trigger: 36-1
|
||||||
|
//Advance: 10
|
||||||
|
//triggerAngle=270
|
||||||
|
test_setup_36_1();
|
||||||
|
configPage4.sparkMode = IGN_MODE_WASTED;
|
||||||
|
ignition2EndAngle = 180 - 10; //Set 10 degrees advance
|
||||||
|
configPage4.triggerAngle = 270; //No trigger offset
|
||||||
|
|
||||||
|
triggerSetEndTeeth_missingTooth();
|
||||||
|
TEST_ASSERT_EQUAL(25, ignition2EndTooth);
|
||||||
|
}
|
||||||
|
|
||||||
|
void test_missingtooth_newIgn_36_1_trig360_2()
|
||||||
|
{
|
||||||
|
//Test the set end tooth function. Conditions:
|
||||||
|
//Trigger: 36-1
|
||||||
|
//Advance: 10
|
||||||
|
//triggerAngle=360
|
||||||
|
test_setup_36_1();
|
||||||
|
configPage4.sparkMode = IGN_MODE_WASTED;
|
||||||
|
ignition2EndAngle = 180 - 10; //Set 10 degrees advance
|
||||||
|
configPage4.triggerAngle = 360; //No trigger offset
|
||||||
|
|
||||||
|
triggerSetEndTeeth_missingTooth();
|
||||||
|
TEST_ASSERT_EQUAL(16, ignition2EndTooth);
|
||||||
|
}
|
||||||
|
|
||||||
|
void test_missingtooth_newIgn_36_1_trigNeg90_2()
|
||||||
|
{
|
||||||
|
//Test the set end tooth function. Conditions:
|
||||||
|
//Trigger: 36-1
|
||||||
|
//Advance: 10
|
||||||
|
//triggerAngle=-90
|
||||||
|
test_setup_36_1();
|
||||||
|
configPage4.sparkMode = IGN_MODE_WASTED;
|
||||||
|
ignition2EndAngle = 180 - 10; //Set 10 degrees advance
|
||||||
|
configPage4.triggerAngle = -90; //No trigger offset
|
||||||
|
|
||||||
|
triggerSetEndTeeth_missingTooth();
|
||||||
|
TEST_ASSERT_EQUAL(25, ignition2EndTooth);
|
||||||
|
}
|
||||||
|
|
||||||
|
void test_missingtooth_newIgn_36_1_trigNeg180_2()
|
||||||
|
{
|
||||||
|
//Test the set end tooth function. Conditions:
|
||||||
|
//Trigger: 36-1
|
||||||
|
//Advance: 10
|
||||||
|
//triggerAngle=-180
|
||||||
|
test_setup_36_1();
|
||||||
|
configPage4.sparkMode = IGN_MODE_WASTED;
|
||||||
|
ignition2EndAngle = 180 - 10; //Set 10 degrees advance
|
||||||
|
configPage4.triggerAngle = -180; //No trigger offset
|
||||||
|
|
||||||
|
triggerSetEndTeeth_missingTooth();
|
||||||
|
TEST_ASSERT_EQUAL(34, ignition2EndTooth);
|
||||||
|
}
|
||||||
|
|
||||||
|
void test_missingtooth_newIgn_36_1_trigNeg270_2()
|
||||||
|
{
|
||||||
|
//Test the set end tooth function. Conditions:
|
||||||
|
//Trigger: 36-1
|
||||||
|
//Advance: 10
|
||||||
|
//triggerAngle=-270
|
||||||
|
test_setup_36_1();
|
||||||
|
configPage4.sparkMode = IGN_MODE_WASTED;
|
||||||
|
ignition2EndAngle = 180 - 10; //Set 10 degrees advance
|
||||||
|
configPage4.triggerAngle = -270; //No trigger offset
|
||||||
|
|
||||||
|
triggerSetEndTeeth_missingTooth();
|
||||||
|
TEST_ASSERT_EQUAL(7, ignition2EndTooth);
|
||||||
|
}
|
||||||
|
|
||||||
|
void test_missingtooth_newIgn_36_1_trigNeg360_2()
|
||||||
|
{
|
||||||
|
//Test the set end tooth function. Conditions:
|
||||||
|
//Trigger: 36-1
|
||||||
|
//Advance: 10
|
||||||
|
//triggerAngle=-360
|
||||||
|
test_setup_36_1();
|
||||||
|
configPage4.sparkMode = IGN_MODE_WASTED;
|
||||||
|
ignition2EndAngle = 180 - 10; //Set 10 degrees advance
|
||||||
|
configPage4.triggerAngle = -360; //No trigger offset
|
||||||
|
|
||||||
|
triggerSetEndTeeth_missingTooth();
|
||||||
|
TEST_ASSERT_EQUAL(16, ignition2EndTooth);
|
||||||
|
}
|
||||||
|
|
||||||
|
void test_missingtooth_newIgn_60_2_trig0_2()
|
||||||
|
{
|
||||||
|
//Test the set end tooth function. Conditions:
|
||||||
|
//Trigger: 60-2
|
||||||
|
//Advance: 10
|
||||||
|
//triggerAngle=300
|
||||||
|
test_setup_60_2();
|
||||||
|
configPage4.sparkMode = IGN_MODE_WASTED;
|
||||||
|
ignition2EndAngle = 180 - 10; //Set 10 degrees advance
|
||||||
|
configPage4.triggerAngle = 0; //No trigger offset
|
||||||
|
|
||||||
|
triggerSetEndTeeth_missingTooth();
|
||||||
|
TEST_ASSERT_EQUAL(57, ignition2EndTooth);
|
||||||
|
}
|
||||||
|
|
||||||
|
void test_missingtooth_newIgn_60_2_trig181_2()
|
||||||
|
{
|
||||||
|
//Test the set end tooth function. Conditions:
|
||||||
|
//Trigger: 60-2
|
||||||
|
//Advance: 10
|
||||||
|
//triggerAngle=300
|
||||||
|
test_setup_60_2();
|
||||||
|
configPage4.sparkMode = IGN_MODE_WASTED;
|
||||||
|
ignition2EndAngle = 180 - 10; //Set 10 degrees advance
|
||||||
|
configPage4.triggerAngle = 181; //No trigger offset
|
||||||
|
|
||||||
|
triggerSetEndTeeth_missingTooth();
|
||||||
|
TEST_ASSERT_EQUAL(58, ignition2EndTooth);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void test_missingtooth_newIgn_2()
|
void test_missingtooth_newIgn_2()
|
||||||
{
|
{
|
||||||
|
|
||||||
|
@ -39,3 +341,29 @@ void test_missingtooth_newIgn_4()
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void testMissingTooth()
|
||||||
|
{
|
||||||
|
RUN_TEST(test_missingtooth_newIgn_36_1_trig0_1);
|
||||||
|
RUN_TEST(test_missingtooth_newIgn_36_1_trig90_1);
|
||||||
|
RUN_TEST(test_missingtooth_newIgn_36_1_trig180_1);
|
||||||
|
RUN_TEST(test_missingtooth_newIgn_36_1_trig270_1);
|
||||||
|
RUN_TEST(test_missingtooth_newIgn_36_1_trig360_1);
|
||||||
|
RUN_TEST(test_missingtooth_newIgn_36_1_trigNeg90_1);
|
||||||
|
RUN_TEST(test_missingtooth_newIgn_36_1_trigNeg180_1);
|
||||||
|
RUN_TEST(test_missingtooth_newIgn_36_1_trigNeg270_1);
|
||||||
|
RUN_TEST(test_missingtooth_newIgn_36_1_trigNeg360_1);
|
||||||
|
|
||||||
|
RUN_TEST(test_missingtooth_newIgn_36_1_trig0_2);
|
||||||
|
RUN_TEST(test_missingtooth_newIgn_36_1_trig90_2);
|
||||||
|
RUN_TEST(test_missingtooth_newIgn_36_1_trig180_2);
|
||||||
|
RUN_TEST(test_missingtooth_newIgn_36_1_trig270_2);
|
||||||
|
RUN_TEST(test_missingtooth_newIgn_36_1_trig360_2);
|
||||||
|
RUN_TEST(test_missingtooth_newIgn_36_1_trigNeg90_2);
|
||||||
|
RUN_TEST(test_missingtooth_newIgn_36_1_trigNeg180_2);
|
||||||
|
RUN_TEST(test_missingtooth_newIgn_36_1_trigNeg270_2);
|
||||||
|
RUN_TEST(test_missingtooth_newIgn_36_1_trigNeg360_2);
|
||||||
|
|
||||||
|
//RUN_TEST(test_missingtooth_newIgn_60_2_trig181_2);
|
||||||
|
//RUN_TEST(test_missingtooth_newIgn_60_2_trig182_2);
|
||||||
|
}
|
|
@ -1,5 +1 @@
|
||||||
|
void testMissingTooth();
|
||||||
void test_missingtooth_newIgn_1();
|
|
||||||
void test_missingtooth_newIgn_3();
|
|
||||||
void test_missingtooth_newIgn_3();
|
|
||||||
void test_missingtooth_newIgn_4();
|
|
||||||
|
|
|
@ -7,5 +7,5 @@
|
||||||
|
|
||||||
void testDecoders()
|
void testDecoders()
|
||||||
{
|
{
|
||||||
RUN_TEST(test_missingtooth_newIgn_1);
|
testMissingTooth();
|
||||||
}
|
}
|
Loading…
Reference in New Issue