fsfw/osal/FreeRTOS/TaskManagement.cpp

25 lines
680 B
C++
Raw Normal View History

#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();
}
}
2020-05-01 16:47:53 +02:00
TaskHandle_t TaskManagement::getCurrentTaskHandle() {
return xTaskGetCurrentTaskHandle();
}
2020-07-11 13:38:14 +02:00
size_t TaskManagement::getTaskStackHighWatermark(
2020-07-10 19:34:18 +02:00
TaskHandle_t task) {
2020-07-11 13:38:14 +02:00
return uxTaskGetStackHighWaterMark(task) * sizeof(StackType_t);
}