2020-02-26 16:55:35 +01:00
|
|
|
#include <framework/osal/FreeRTOS/TaskManagement.h>
|
2020-05-18 17:46:04 +02:00
|
|
|
|
2020-02-28 22:55:25 +01:00
|
|
|
void TaskManagement::requestContextSwitchFromTask() {
|
2020-02-26 16:55:35 +01:00
|
|
|
vTaskDelay(0);
|
|
|
|
}
|
2020-05-18 20:46:50 +02:00
|
|
|
|
2020-05-18 17:46:04 +02:00
|
|
|
void TaskManagement::requestContextSwitch(
|
2020-05-18 20:46:50 +02:00
|
|
|
CallContext callContext = CallContext::task) {
|
2020-03-02 01:00:17 +01:00
|
|
|
if(callContext == CallContext::isr) {
|
2020-02-26 16:55:35 +01:00
|
|
|
// This function depends on the partmacro.h definition for the specific device
|
2020-04-23 17:54:41 +02:00
|
|
|
requestContextSwitchFromISR();
|
2020-02-26 16:55:35 +01:00
|
|
|
} else {
|
|
|
|
requestContextSwitchFromTask();
|
|
|
|
}
|
|
|
|
}
|
2020-05-18 17:46:04 +02:00
|
|
|
|
2020-05-01 16:47:53 +02:00
|
|
|
TaskHandle_t TaskManagement::getCurrentTaskHandle() {
|
|
|
|
return xTaskGetCurrentTaskHandle();
|
|
|
|
}
|
|
|
|
|
|
|
|
configSTACK_DEPTH_TYPE TaskManagement::getTaskStackHighWatermark() {
|
|
|
|
return uxTaskGetStackHighWaterMark(TaskManagement::getCurrentTaskHandle());
|
2020-05-18 20:46:50 +02:00
|
|
|
}
|