fsfw/osal/FreeRTOS/TaskManagement.cpp
2020-05-29 13:31:55 +02:00

24 lines
681 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());
}