2020-05-18 17:22:10 +02:00
|
|
|
#include <framework/osal/FreeRTOS/TaskManagement.h>
|
2020-05-18 17:46:04 +02:00
|
|
|
|
2020-05-18 17:22:10 +02:00
|
|
|
void TaskManagement::requestContextSwitchFromTask() {
|
|
|
|
vTaskDelay(0);
|
|
|
|
}
|
|
|
|
|
2020-05-18 17:46:04 +02:00
|
|
|
void TaskManagement::requestContextSwitch(
|
|
|
|
CallContext callContext = CallContext::task) {
|
2020-05-18 17:22:10 +02:00
|
|
|
if(callContext == CallContext::isr) {
|
|
|
|
// This function depends on the partmacro.h definition for the specific device
|
|
|
|
requestContextSwitchFromISR();
|
|
|
|
} else {
|
|
|
|
requestContextSwitchFromTask();
|
|
|
|
}
|
|
|
|
}
|
2020-05-18 17:46:04 +02:00
|
|
|
|
2020-05-18 17:22:10 +02:00
|
|
|
TaskHandle_t TaskManagement::getCurrentTaskHandle() {
|
|
|
|
return xTaskGetCurrentTaskHandle();
|
|
|
|
}
|
|
|
|
|
|
|
|
configSTACK_DEPTH_TYPE TaskManagement::getTaskStackHighWatermark() {
|
|
|
|
return uxTaskGetStackHighWaterMark(TaskManagement::getCurrentTaskHandle());
|
|
|
|
}
|