From 67a3796086867579a2c2dc4ea9a94f7f5e9cffff Mon Sep 17 00:00:00 2001 From: rusefi Date: Fri, 10 Jan 2020 23:17:58 -0500 Subject: [PATCH] better method names --- .../engine_cycle/main_trigger_callback.cpp | 14 +++++++------- .../engine_cycle/main_trigger_callback.h | 4 ++-- .../system/timer/signal_executor_sleep.cpp | 8 ++++---- unit_tests/engine_test_helper.cpp | 4 ++-- unit_tests/tests/test_fasterEngineSpinningUp.cpp | 4 ++-- 5 files changed, 17 insertions(+), 17 deletions(-) diff --git a/firmware/controllers/engine_cycle/main_trigger_callback.cpp b/firmware/controllers/engine_cycle/main_trigger_callback.cpp index 273614d360..438316ca53 100644 --- a/firmware/controllers/engine_cycle/main_trigger_callback.cpp +++ b/firmware/controllers/engine_cycle/main_trigger_callback.cpp @@ -100,7 +100,7 @@ static inline void tempTurnPinHigh(InjectorOutputPin *output) { output->overlappingCounter++; #if FUEL_MATH_EXTREME_LOGGING - printf("seTurnPinHigh %s %d %d\r\n", output->name, output->overlappingCounter, (int)getTimeNowUs()); + printf("turnInjectionPinHigh %s %d %d\r\n", output->name, output->overlappingCounter, (int)getTimeNowUs()); #endif /* FUEL_MATH_EXTREME_LOGGING */ if (output->overlappingCounter > 1) { @@ -123,7 +123,7 @@ static inline void tempTurnPinHigh(InjectorOutputPin *output) { } // todo: make these macro? kind of a penny optimization if compiler is not smart to inline -void seTurnPinHigh(InjectionEvent *event) { +void turnInjectionPinHigh(InjectionEvent *event) { for (int i = 0;i < MAX_WIRES_COUNT;i++) { InjectorOutputPin *output = event->outputs[i]; if (output != NULL) { @@ -134,7 +134,7 @@ void seTurnPinHigh(InjectionEvent *event) { static inline void turnInjectionPinLow(InjectorOutputPin *output) { #if FUEL_MATH_EXTREME_LOGGING - printf("seTurnPinLow %s %d %d\r\n", output->name, output->overlappingCounter, (int)getTimeNowUs()); + printf("turnInjectionPinLow %s %d %d\r\n", output->name, output->overlappingCounter, (int)getTimeNowUs()); #endif /* FUEL_MATH_EXTREME_LOGGING */ if (output->cancelNextTurningInjectorOff) { @@ -171,7 +171,7 @@ static inline void turnInjectionPinLow(InjectorOutputPin *output) { } } -void seTurnPinLow(InjectionEvent *event) { +void turnInjectionPinLow(InjectionEvent *event) { event->isScheduled = false; for (int i = 0;ioutputs[i]; @@ -192,7 +192,7 @@ static void sescheduleByTimestamp(scheduling_s *scheduling, efitimeus_t time, ac // scheduleMsg(&sharedLogger, "schX %s %x %d", prefix, scheduling, time); // scheduleMsg(&sharedLogger, "schX %s", param->name); - const char *direction = callback == &seTurnPinHigh ? "up" : "down"; + const char *direction = callback == &turnInjectionPinHigh ? "up" : "down"; printf("seScheduleByTime %s %s %d sch=%d\r\n", direction, param->name, (int)time, (int)scheduling); #endif /* FUEL_MATH_EXTREME_LOGGING || EFI_UNIT_TEST */ @@ -327,10 +327,10 @@ static ALWAYS_INLINE void handleFuelInjectionEvent(int injEventIndex, InjectionE printf("please cancel %s %d %d\r\n", output->name, (int)getTimeNowUs(), output->overlappingCounter); #endif /* EFI_UNIT_TEST || EFI_SIMULATOR */ } else { - sescheduleByTimestamp(sUp, turnOnTime, { &seTurnPinHigh, event } PASS_ENGINE_PARAMETER_SUFFIX); + sescheduleByTimestamp(sUp, turnOnTime, { &turnInjectionPinHigh, event } PASS_ENGINE_PARAMETER_SUFFIX); } efitimeus_t turnOffTime = nowUs + (int) (injectionStartDelayUs + durationUs); - sescheduleByTimestamp(sDown, turnOffTime, { &seTurnPinLow, event } PASS_ENGINE_PARAMETER_SUFFIX); + sescheduleByTimestamp(sDown, turnOffTime, { &turnInjectionPinLow, event } PASS_ENGINE_PARAMETER_SUFFIX); } } diff --git a/firmware/controllers/engine_cycle/main_trigger_callback.h b/firmware/controllers/engine_cycle/main_trigger_callback.h index 048867939f..d4f1c33d4d 100644 --- a/firmware/controllers/engine_cycle/main_trigger_callback.h +++ b/firmware/controllers/engine_cycle/main_trigger_callback.h @@ -19,8 +19,8 @@ void startPrimeInjectionPulse(DECLARE_ENGINE_PARAMETER_SIGNATURE); void startSimultaniousInjection(Engine *engine); void endSimultaniousInjection(InjectionEvent *event); -void seTurnPinHigh(InjectionEvent *event); -void seTurnPinLow(InjectionEvent *event); +void turnInjectionPinHigh(InjectionEvent *event); +void turnInjectionPinLow(InjectionEvent *event); // reset injection switch counter if the engine started spinning void updatePrimeInjectionPulseState(DECLARE_ENGINE_PARAMETER_SIGNATURE); diff --git a/firmware/controllers/system/timer/signal_executor_sleep.cpp b/firmware/controllers/system/timer/signal_executor_sleep.cpp index 2579571006..9870d15fc7 100644 --- a/firmware/controllers/system/timer/signal_executor_sleep.cpp +++ b/firmware/controllers/system/timer/signal_executor_sleep.cpp @@ -43,8 +43,8 @@ void SleepExecutor::scheduleByTimestampNt(scheduling_s* scheduling, efitick_t ti static void timerCallback(scheduling_s *scheduling) { #if EFI_PRINTF_FUEL_DETAILS - if (scheduling->action.getCallback() == (schfunc_t)&seTurnPinLow) { - printf("executing cb=seTurnPinLow p=%d sch=%d now=%d\r\n", (int)scheduling->action.getArgument(), (int)scheduling, + if (scheduling->action.getCallback() == (schfunc_t)&turnInjectionPinLow) { + printf("executing cb=turnInjectionPinLow p=%d sch=%d now=%d\r\n", (int)scheduling->action.getArgument(), (int)scheduling, (int)getTimeNowUs()); } else { // printf("exec cb=%d p=%d\r\n", (int)scheduling->callback, (int)scheduling->param); @@ -75,8 +75,8 @@ static void doScheduleForLater(scheduling_s *scheduling, int delayUs, action_s a } #if EFI_SIMULATOR - if (action.getCallback() == (schfunc_t)&seTurnPinLow) { - printf("setTime cb=seTurnPinLow p=%d\r\n", (int)action.getArgument()); + if (action.getCallback() == (schfunc_t)&turnInjectionPinLow) { + printf("setTime cb=turnInjectionPinLow p=%d\r\n", (int)action.getArgument()); } else { // printf("setTime cb=%d p=%d\r\n", (int)callback, (int)param); } diff --git a/unit_tests/engine_test_helper.cpp b/unit_tests/engine_test_helper.cpp index 2e2a4691e5..f075d0bb32 100644 --- a/unit_tests/engine_test_helper.cpp +++ b/unit_tests/engine_test_helper.cpp @@ -145,12 +145,12 @@ void EngineTestHelper::fireTriggerEvents(int count) { void EngineTestHelper::assertInjectorUpEvent(const char *msg, int eventIndex, efitime_t momentX, long injectorIndex) { InjectionEvent *event = &engine.injectionEvents.elements[injectorIndex]; - assertEvent(msg, eventIndex, (void*)seTurnPinHigh, momentX, event); + assertEvent(msg, eventIndex, (void*)turnInjectionPinHigh, momentX, event); } void EngineTestHelper::assertInjectorDownEvent(const char *msg, int eventIndex, efitime_t momentX, long injectorIndex) { InjectionEvent *event = &engine.injectionEvents.elements[injectorIndex]; - assertEvent(msg, eventIndex, (void*)seTurnPinLow, momentX, event); + assertEvent(msg, eventIndex, (void*)turnInjectionPinLow, momentX, event); } scheduling_s * EngineTestHelper::assertEvent5(const char *msg, int index, void *callback, efitime_t expectedTimestamp) { diff --git a/unit_tests/tests/test_fasterEngineSpinningUp.cpp b/unit_tests/tests/test_fasterEngineSpinningUp.cpp index 1ee97d9926..5a22ea545e 100644 --- a/unit_tests/tests/test_fasterEngineSpinningUp.cpp +++ b/unit_tests/tests/test_fasterEngineSpinningUp.cpp @@ -93,8 +93,8 @@ TEST(cranking, testFasterEngineSpinningUp) { // check real events for sequential injection // Note: See addFuelEvents() fix inside setRpmValue()! - eth.assertEvent5("inj start#3", 0, (void*)seTurnPinHigh, -31875); - eth.assertEvent5("inj end#3", 1, (void*)seTurnPinLow, -30000); + eth.assertEvent5("inj start#3", 0, (void*)turnInjectionPinHigh, -31875); + eth.assertEvent5("inj end#3", 1, (void*)turnInjectionPinLow, -30000); } static void doTestFasterEngineSpinningUp60_2(int startUpDelayMs, int rpm1, int expectedRpm) {