From ac6dc3c0f1a29b761ed60f0ea1fd1d4f6e8965c2 Mon Sep 17 00:00:00 2001 From: rusefi Date: Mon, 27 Mar 2017 22:54:22 -0400 Subject: [PATCH] manual picking from ChibiOS migration branch to make my evening a little less depressing --- firmware/console/console_io.cpp | 6 +++--- firmware/controllers/map_averaging.cpp | 12 ++++++------ 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/firmware/console/console_io.cpp b/firmware/console/console_io.cpp index 3cecc37ecf..e3f7d9d71d 100644 --- a/firmware/console/console_io.cpp +++ b/firmware/console/console_io.cpp @@ -151,7 +151,7 @@ void runConsoleLoop(ts_channel_s *console) { } while (true) { - efiAssertVoid(getRemainingStack(chThdSelf()) > 256, "lowstck#9e"); + efiAssertVoid(getRemainingStack(chThdGetSelfX()) > 256, "lowstck#9e"); bool end = getConsoleLine((BaseSequentialStream*) console->channel, console->crcReadBuffer, sizeof(console->crcReadBuffer) - 3); if (end) { // firmware simulator is the only case when this happens @@ -285,7 +285,7 @@ bool lockAnyContext(void) { if (alreadyLocked) return true; if (isIsrContext()) { - chSysLockFromIsr() + chSysLockFromISR() ; } else { chSysLock() @@ -300,7 +300,7 @@ bool lockOutputBuffer(void) { void unlockAnyContext(void) { if (isIsrContext()) { - chSysUnlockFromIsr() + chSysUnlockFromISR() ; } else { chSysUnlock() diff --git a/firmware/controllers/map_averaging.cpp b/firmware/controllers/map_averaging.cpp index a5fe5fa98e..fa9272f85b 100644 --- a/firmware/controllers/map_averaging.cpp +++ b/firmware/controllers/map_averaging.cpp @@ -91,7 +91,7 @@ static bool isAveraging = false; static void startAveraging(void *arg) { (void) arg; - efiAssertVoid(getRemainingStack(chThdSelf()) > 128, "lowstck#9"); + efiAssertVoid(getRemainingStack(chThdGetSelfX()) > 128, "lowstck#9"); bool wasLocked = lockAnyContext(); ; // with locking we would have a consistent state @@ -99,7 +99,7 @@ static void startAveraging(void *arg) { mapMeasurementsCounter = 0; isAveraging = true; if (!wasLocked) - chSysUnlockFromIsr() + chSysUnlockFromISR() ; turnPinHigh(&mapAveragingPin); } @@ -117,7 +117,7 @@ void mapAveragingCallback(adcsample_t adcValue) { /* Calculates the average values from the ADC samples.*/ measurementsPerRevolutionCounter++; - efiAssertVoid(getRemainingStack(chThdSelf()) > 128, "lowstck#9a"); + efiAssertVoid(getRemainingStack(chThdGetSelfX()) > 128, "lowstck#9a"); #if (EFI_SENSOR_CHART && EFI_ANALOG_SENSORS) || defined(__DOXYGEN__) if (ENGINE(sensorChartMode) == SC_MAP) { @@ -144,13 +144,13 @@ void mapAveragingCallback(adcsample_t adcValue) { readIndex = writeIndex; // todo: migrate to the lock-free implementation - chSysLockFromIsr() + chSysLockFromISR() ; // with locking we would have a consistent state mapAccumulator += adcValue; mapMeasurementsCounter++; - chSysUnlockFromIsr() + chSysUnlockFromISR() ; } #endif @@ -165,7 +165,7 @@ static void endAveraging(void *arg) { mapAccumulator / mapMeasurementsCounter); #endif if (!wasLocked) - chSysUnlockFromIsr() + chSysUnlockFromISR() ; turnPinLow(&mapAveragingPin); }