From 140e29840a982d84927f01186eabf2ecbddb83fd Mon Sep 17 00:00:00 2001 From: geeksville Date: Thu, 14 May 2020 12:46:29 -0700 Subject: [PATCH] fix rare gurumeditation if we are unlucky and some ISR code is in serial flash --- src/WorkerThread.cpp | 8 +------- src/WorkerThread.h | 7 ++++++- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/src/WorkerThread.cpp b/src/WorkerThread.cpp index ed1103911..f84d83be2 100644 --- a/src/WorkerThread.cpp +++ b/src/WorkerThread.cpp @@ -28,13 +28,7 @@ void NotifiedWorkerThread::notify(uint32_t v, eNotifyAction action) xTaskNotify(taskHandle, v, action); } -/** - * Notify from an ISR - */ -void NotifiedWorkerThread::notifyFromISR(BaseType_t *highPriWoken, uint32_t v, eNotifyAction action) -{ - xTaskNotifyFromISR(taskHandle, v, action, highPriWoken); -} + void NotifiedWorkerThread::block() { diff --git a/src/WorkerThread.h b/src/WorkerThread.h index f951da32c..86ec08e13 100644 --- a/src/WorkerThread.h +++ b/src/WorkerThread.h @@ -61,8 +61,13 @@ class NotifiedWorkerThread : public WorkerThread /** * Notify from an ISR + * + * This must be inline or IRAM_ATTR on ESP32 */ - void notifyFromISR(BaseType_t *highPriWoken, uint32_t v = 0, eNotifyAction action = eNoAction); + inline void notifyFromISR(BaseType_t *highPriWoken, uint32_t v = 0, eNotifyAction action = eNoAction) + { + xTaskNotifyFromISR(taskHandle, v, action, highPriWoken); + } protected: /**