diff --git a/firmware/controllers/algo/signal_executor.h b/firmware/controllers/algo/signal_executor.h index 1bba7b942d..1f0e2c5e6b 100644 --- a/firmware/controllers/algo/signal_executor.h +++ b/firmware/controllers/algo/signal_executor.h @@ -54,7 +54,6 @@ struct OutputSignal_struct { OutputSignalPair signalPair[2]; }; -void seScheduleByTime(const char *prefix, scheduling_s *scheduling, efitimeus_t time, schfunc_t callback, NamedOutputPin *param); void initSignalExecutor(void); void initEnginePinsNames(void); diff --git a/firmware/controllers/trigger/main_trigger_callback.cpp b/firmware/controllers/trigger/main_trigger_callback.cpp index e11ecb6cd3..90f8ff27fa 100644 --- a/firmware/controllers/trigger/main_trigger_callback.cpp +++ b/firmware/controllers/trigger/main_trigger_callback.cpp @@ -312,7 +312,7 @@ static ALWAYS_INLINE void handleFuelInjectionEvent(int injEventIndex, InjectionE * @param dwell the number of ticks of output duration * */ -void scheduleOutput2(scheduling_s * sUp, scheduling_s * sDown, efitimeus_t nowUs, float delayUs, float durationUs, InjectorOutputPin *output) { +static void scheduleOutput2(OutputSignalPair *pair, efitimeus_t nowUs, float delayUs, float durationUs, InjectorOutputPin *output) { #if EFI_GPIO || defined(__DOXYGEN__) #if EFI_UNIT_TEST || defined(__DOXYGEN__) @@ -321,6 +321,9 @@ void scheduleOutput2(scheduling_s * sUp, scheduling_s * sDown, efitimeus_t nowUs efitimeus_t turnOnTime = nowUs + (int) delayUs; + scheduling_s *sUp = &pair->signalTimerUp; + scheduling_s *sDown = &pair->signalTimerDown; + seScheduleByTime("out up", sUp, turnOnTime, (schfunc_t) &seTurnPinHigh, output); efitimeus_t turnOffTime = nowUs + (int) (delayUs + durationUs); @@ -345,14 +348,13 @@ static void handleFuelScheduleOverlap(InjectionEventList *injectionEvents DECLAR // todo: recalc fuel? account for wetting? floatms_t injectionDuration = ENGINE(fuelMs); - scheduling_s * sUp = &ENGINE(engineConfiguration2)->overlappingFuelActuator[injEventIndex].signalTimerUp; - scheduling_s * sDown = &ENGINE(engineConfiguration2)->overlappingFuelActuator[injEventIndex].signalTimerDown; + OutputSignalPair* pair = &ENGINE(engineConfiguration2)->overlappingFuelActuator[injEventIndex]; efitimeus_t nowUs = getTimeNowUs(); output->overlappingScheduleOffTime = nowUs + MS2US(injectionDuration); - scheduleOutput2(sUp, sDown, nowUs, 0, MS2US(injectionDuration), output); + scheduleOutput2(pair, nowUs, 0, MS2US(injectionDuration), output); } } }