Robin.Mueller
1d4d01d190
The task management defines an external function which implements a context switch call from an ISR
25 lines
686 B
C++
25 lines
686 B
C++
#include <framework/osal/FreeRTOS/TaskManagement.h>
|
|
|
|
void TaskManagement::requestContextSwitchFromTask() {
|
|
vTaskDelay(0);
|
|
}
|
|
|
|
void TaskManagement::requestContextSwitch(CallContext callContext = CallContext::task) {
|
|
if(callContext == CallContext::isr) {
|
|
// This function depends on the partmacro.h definition for the specific device
|
|
requestContextSwitchFromISR();
|
|
} else {
|
|
requestContextSwitchFromTask();
|
|
}
|
|
}
|
|
|
|
TaskHandle_t TaskManagement::getCurrentTaskHandle() {
|
|
return xTaskGetCurrentTaskHandle();
|
|
}
|
|
|
|
configSTACK_DEPTH_TYPE TaskManagement::getTaskStackHighWatermark() {
|
|
return uxTaskGetStackHighWaterMark(TaskManagement::getCurrentTaskHandle());
|
|
}
|
|
|
|
|