From 7a4515f78b8153c801974f289af7028906db0a7c Mon Sep 17 00:00:00 2001 From: rusefi Date: Mon, 27 Mar 2017 22:52:43 -0400 Subject: [PATCH] manual picking from ChibiOS migration branch to make my evening a little less depressing --- firmware/controllers/core/fsio_core.cpp | 2 +- firmware/controllers/flash_main.cpp | 2 +- firmware/controllers/system/SingleTimerExecutor.cpp | 2 +- firmware/global.h | 3 +++ 4 files changed, 6 insertions(+), 3 deletions(-) diff --git a/firmware/controllers/core/fsio_core.cpp b/firmware/controllers/core/fsio_core.cpp index bcdab9288e..2c6bb25f0c 100644 --- a/firmware/controllers/core/fsio_core.cpp +++ b/firmware/controllers/core/fsio_core.cpp @@ -144,7 +144,7 @@ void LECalculator::push(le_action_e action, float value) { */ bool LECalculator::processElement(Engine *engine, LEElement *element) { #if EFI_PROD_CODE || defined(__DOXYGEN__) - efiAssert(getRemainingStack(chThdSelf()) > 64, "FSIO logic", false); + efiAssert(getRemainingStack(chThdGetSelfX()) > 64, "FSIO logic", false); #endif switch (element->action) { diff --git a/firmware/controllers/flash_main.cpp b/firmware/controllers/flash_main.cpp index ddce4e643d..9871eaad6c 100644 --- a/firmware/controllers/flash_main.cpp +++ b/firmware/controllers/flash_main.cpp @@ -132,7 +132,7 @@ static persisted_configuration_state_e doReadConfiguration(flashaddr_t address, * connectivity so no console output here */ persisted_configuration_state_e readConfiguration(Logging * logger) { - efiAssert(getRemainingStack(chThdSelf()) > 256, "read f", PC_ERROR); + efiAssert(getRemainingStack(chThdGetSelfX()) > 256, "read f", PC_ERROR); assertEngineReference(PASS_ENGINE_PARAMETER_F); persisted_configuration_state_e result = doReadConfiguration(FLASH_ADDR, logger); if (result != PC_OK) { diff --git a/firmware/controllers/system/SingleTimerExecutor.cpp b/firmware/controllers/system/SingleTimerExecutor.cpp index c828f6598b..1cbcccfe97 100644 --- a/firmware/controllers/system/SingleTimerExecutor.cpp +++ b/firmware/controllers/system/SingleTimerExecutor.cpp @@ -41,7 +41,7 @@ uint32_t lastExecutionCount; static void executorCallback(void *arg) { (void)arg; - efiAssertVoid(getRemainingStack(chThdSelf()) > 256, "lowstck#2y"); + efiAssertVoid(getRemainingStack(chThdGetSelfX()) > 256, "lowstck#2y"); // callbackTime = getTimeNowNt(); // if((callbackTime > nextEventTimeNt) && (callbackTime - nextEventTimeNt > US2NT(5000))) { diff --git a/firmware/global.h b/firmware/global.h index 09cee9cb44..5f8a0715a1 100644 --- a/firmware/global.h +++ b/firmware/global.h @@ -63,6 +63,9 @@ typedef EventListener event_listener_t; typedef EventSource event_source_t; typedef VTList virtual_timers_list_t; typedef VirtualTimer virtual_timer_t; +#define chSysLockFromISR chSysLockFromIsr +#define chSysUnlockFromISR chSysUnlockFromIsr +#define chThdGetSelfX chThdSelf #define HAL_SUCCESS CH_SUCCESS #define HAL_FAILED CH_FAILED