auto-sync

This commit is contained in:
rusEfi 2016-09-26 22:02:53 -04:00
parent c2ae17977c
commit 7430da9689
4 changed files with 7 additions and 7 deletions

View File

@ -51,8 +51,7 @@ struct OutputSignal_struct {
* We are alternating instances so that events which extend into next revolution are not reused while
* scheduling next revolution events
*/
scheduling_s signalTimerUp[2];
scheduling_s signalTimerDown[2];
OutputSignalPair signalPair[2];
};
void seScheduleByTime(const char *prefix, scheduling_s *scheduling, efitimeus_t time, schfunc_t callback, NamedOutputPin *param);

View File

@ -25,6 +25,7 @@
#include "main.h"
#include "scheduler.h"
#include "signal_executor.h"
#include "main_trigger_callback.h"
#if EFI_SIMULATOR || defined(__DOXYGEN__)
// this is about debugging

View File

@ -198,8 +198,8 @@ static void scheduleFuelInjection(int rpm, int injEventIndex, OutputSignal *sign
efiAssertVoid(signal!=NULL, "signal is NULL");
int index = getRevolutionCounter() % 2;
scheduling_s * sUp = &signal->signalTimerUp[index];
scheduling_s * sDown = &signal->signalTimerDown[index];
scheduling_s * sUp = &signal->signalPair[index].signalTimerUp;
scheduling_s * sDown = &signal->signalPair[index].signalTimerDown;
efitimeus_t turnOnTime = nowUs + (int) delayUs;
bool isSecondaryOverlapping = turnOnTime < output->overlappingScheduleOffTime;
@ -279,8 +279,8 @@ static ALWAYS_INLINE void handleFuelInjectionEvent(int injEventIndex, InjectionE
*/
efiAssertVoid(signal!=NULL, "signal is NULL");
int index = getRevolutionCounter() % 2;
scheduling_s * sUp = &signal->signalTimerUp[index];
scheduling_s * sDown = &signal->signalTimerDown[index];
scheduling_s * sUp = &signal->signalPair[index].signalTimerUp;
scheduling_s * sDown = &signal->signalPair[index].signalTimerDown;
scheduleTask("out up", sUp, (int) injectionStartDelayUs, (schfunc_t) &startSimultaniousInjection, engine);
scheduleTask("out down", sDown, (int) injectionStartDelayUs + MS2US(injectionDuration),

View File

@ -802,7 +802,7 @@ void testFuelSchedulerBug299smallAndMedium(void) {
{
scheduling_s *ev = schedulingQueue.getForUnitText(9);
assertEqualsM("rev cnt#4#2", 5, engine->rpmCalculator.getRevolutionCounter());
assertTrueM("down 50", ev == &engine->engineConfiguration2->fuelActuators[2].signalTimerDown[1]);
assertTrueM("down 50", ev == &engine->engineConfiguration2->fuelActuators[2].signalPair[1].signalTimerDown);
}