1
0
forked from me/IronOS

Spawn PD earlier

This commit is contained in:
Ben V. Brown
2021-04-05 14:37:50 +10:00
parent fc08dc42fa
commit b3c3e4e384
7 changed files with 21 additions and 28 deletions

View File

@@ -25,7 +25,7 @@
#include "task.h"
#include <pd.h>
osThreadId InterruptHandler::TaskHandle = NULL;
volatile osThreadId InterruptHandler::TaskHandle = NULL;
uint32_t InterruptHandler::TaskBuffer[InterruptHandler::TaskStackSize];
osStaticThreadDef_t InterruptHandler::TaskControlBlock;
@@ -68,11 +68,9 @@ void InterruptHandler::Thread(const void *arg) {
}
}
void InterruptHandler::irqCallback() {
if (xTaskGetSchedulerState() != taskSCHEDULER_NOT_STARTED) {
if (TaskHandle != NULL) {
BaseType_t taskWoke = pdFALSE;
xTaskNotifyFromISR(TaskHandle, 0x01, eNotifyAction::eSetBits, &taskWoke);
portYIELD_FROM_ISR(taskWoke);
}
if (TaskHandle != NULL) {
BaseType_t taskWoke = pdFALSE;
xTaskNotifyFromISR(TaskHandle, 0, eNotifyAction::eNoAction, &taskWoke);
portYIELD_FROM_ISR(taskWoke);
}
}