This commit is contained in:
rusefi 2018-03-04 16:34:23 -05:00
parent 8349897644
commit cc889cf315
2 changed files with 9 additions and 4 deletions

View File

@ -77,11 +77,16 @@ void EngineTestHelper::firePrimaryTriggerFall() {
engine.triggerCentral.handleShaftSignal(SHAFT_PRIMARY_FALLING, &engine, engine.engineConfiguration, &persistentConfig, boardConfiguration);
}
void EngineTestHelper::fireTriggerEvents2(int count, int duration) {
/**
* Sends specified number of rise/fall trigger events, with specified amount of time between those.
*
* This is helpful for TT_ONE trigger wheel decoder and probably other decoders as well.
*/
void EngineTestHelper::fireTriggerEvents2(int count, int durationUs) {
for (int i = 0; i < count; i++) {
timeNowUs += duration;
timeNowUs += durationUs;
firePrimaryTriggerRise();
timeNowUs += duration;
timeNowUs += durationUs;
firePrimaryTriggerFall();
}
}

View File

@ -19,7 +19,7 @@ public:
void firePrimaryTriggerRise();
void firePrimaryTriggerFall();
void fireTriggerEvents(int count);
void fireTriggerEvents2(int count, int duration);
void fireTriggerEvents2(int count, int durationUs);
persistent_config_s persistentConfig;
Engine engine;