From ab94192135fcd5f574d7d1c81556ff68280afa17 Mon Sep 17 00:00:00 2001 From: rusefi Date: Mon, 24 Jul 2017 19:38:00 -0400 Subject: [PATCH] better global variable name --- firmware/controllers/engine_controller.cpp | 2 +- firmware/controllers/injector_central.cpp | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/firmware/controllers/engine_controller.cpp b/firmware/controllers/engine_controller.cpp index e0ffe101d1..e793aa5f2b 100644 --- a/firmware/controllers/engine_controller.cpp +++ b/firmware/controllers/engine_controller.cpp @@ -282,7 +282,7 @@ static void periodicSlowCallback(Engine *engine) { #if (EFI_PROD_CODE && EFI_FSIO) || defined(__DOXYGEN__) runFsio(); -#endif +#endif /* EFI_PROD_CODE && EFI_FSIO */ cylinderCleanupControl(engine); diff --git a/firmware/controllers/injector_central.cpp b/firmware/controllers/injector_central.cpp index 8a5101d374..5658ff0c58 100644 --- a/firmware/controllers/injector_central.cpp +++ b/firmware/controllers/injector_central.cpp @@ -112,7 +112,7 @@ static void runBench(brain_pin_e brainPin, OutputPin *output, float delayMs, flo isRunningBench = false; } -static volatile bool needToRunBench = false; +static volatile bool isBenchTestPending = false; static float onTime; static float offTime; static float delayMs; @@ -129,7 +129,7 @@ static void pinbench(const char *delayStr, const char *onTimeStr, const char *of brainPin = brainPinParam; pinX = pinParam; - needToRunBench = true; + isBenchTestPending = true; } static void doRunFuel(int humanIndex, const char *delayStr, const char * onTimeStr, const char *offTimeStr, @@ -213,10 +213,11 @@ static msg_t benchThread(int param) { chRegSetThreadName("BenchThread"); while (true) { - while (!needToRunBench) { + // naive inter-thread communication - waiting for a flag + while (!isBenchTestPending) { chThdSleepMilliseconds(200); } - needToRunBench = false; + isBenchTestPending = false; runBench(brainPin, pinX, delayMs, onTime, offTime, count); } #if defined __GNUC__