From 788e69aadccf26ccc1122a9469da5f1d72d01d52 Mon Sep 17 00:00:00 2001 From: rusefi Date: Sun, 7 Jul 2019 19:59:48 -0400 Subject: [PATCH] More than one aux pid #866 refactoring --- firmware/console/binary/tunerstudio.cpp | 2 +- firmware/controllers/engine_controller.cpp | 21 +++++++++------------ 2 files changed, 10 insertions(+), 13 deletions(-) diff --git a/firmware/console/binary/tunerstudio.cpp b/firmware/console/binary/tunerstudio.cpp index 3b26f6e714..b8d54df6c4 100644 --- a/firmware/console/binary/tunerstudio.cpp +++ b/firmware/console/binary/tunerstudio.cpp @@ -795,7 +795,7 @@ int tunerStudioHandleCrcCommand(ts_channel_s *tsChannel, char *data, int incomin } break; #if EFI_TOOTH_LOGGER - case TS_SET_LOGGER_MODE: + case TS_SET_LOGGER_MODE: switch(data[0]) { case 0x01: EnableToothLogger(); diff --git a/firmware/controllers/engine_controller.cpp b/firmware/controllers/engine_controller.cpp index 5ee12dddb9..cc7daeaf6e 100644 --- a/firmware/controllers/engine_controller.cpp +++ b/firmware/controllers/engine_controller.cpp @@ -226,15 +226,6 @@ efitimesec_t getTimeNowSeconds(void) { #endif /* EFI_PROD_CODE */ -static void periodicSlowCallback(DECLARE_ENGINE_PARAMETER_SIGNATURE); - -static void scheduleNextSlowInvocation(void) { - // schedule next invocation - // we need at least protection from zero value while resetting configuration - int periodMs = maxI(50, CONFIGB(generalPeriodicThreadPeriodMs)); - chVTSetAny(&periodicSlowTimer, TIME_MS2I(periodMs), (vtfunc_t) &periodicSlowCallback, NULL); -} - static void periodicFastCallback(DECLARE_ENGINE_PARAMETER_SIGNATURE) { engine->periodicFastCallback(); /** @@ -285,7 +276,7 @@ static void invokePerSecond(void) { #endif /* EFI_CLOCK_LOCKS */ } -static void periodicSlowCallback(DECLARE_ENGINE_PARAMETER_SIGNATURE) { +static void doPeriodicSlowCallback(DECLARE_ENGINE_PARAMETER_SIGNATURE) { #if EFI_ENGINE_CONTROL && EFI_SHAFT_POSITION_INPUT efiAssertVoid(CUSTOM_ERR_6661, getCurrentRemainingStack() > 64, "lowStckOnEv"); #if EFI_PROD_CODE @@ -327,11 +318,17 @@ static void periodicSlowCallback(DECLARE_ENGINE_PARAMETER_SIGNATURE) { } engine->periodicSlowCallback(PASS_ENGINE_PARAMETER_SIGNATURE); - - scheduleNextSlowInvocation(); #endif } +static void periodicSlowCallback(DECLARE_ENGINE_PARAMETER_SIGNATURE) { + doPeriodicSlowCallback(PASS_ENGINE_PARAMETER_SIGNATURE); + // schedule next invocation + // we need at least protection from zero value while resetting configuration + int periodMs = maxI(50, CONFIGB(generalPeriodicThreadPeriodMs)); + chVTSetAny(&periodicSlowTimer, TIME_MS2I(periodMs), (vtfunc_t) &periodicSlowCallback, NULL); +} + void initPeriodicEvents(DECLARE_ENGINE_PARAMETER_SIGNATURE) { periodicSlowCallback(PASS_ENGINE_PARAMETER_SIGNATURE); periodicFastCallback(PASS_ENGINE_PARAMETER_SIGNATURE);