fsfw/osal/FreeRTOS/TaskManagement.cpp

25 lines
684 B
C++
Raw Normal View History

2020-08-25 12:40:06 +02:00
#include "../../osal/FreeRTOS/TaskManagement.h"
2020-08-08 13:15:41 +02:00
void TaskManagement::vRequestContextSwitchFromTask() {
vTaskDelay(0);
}
2020-08-25 12:40:06 +02:00
2020-08-08 13:15:41 +02:00
void TaskManagement::requestContextSwitch(
2020-08-25 12:40:06 +02:00
CallContext callContext = CallContext::TASK) {
2020-08-08 13:15:41 +02:00
if(callContext == CallContext::ISR) {
// This function depends on the partmacro.h definition for the specific device
vRequestContextSwitchFromISR();
} else {
vRequestContextSwitchFromTask();
}
}
2020-08-25 12:40:06 +02:00
2020-08-08 13:15:41 +02:00
TaskHandle_t TaskManagement::getCurrentTaskHandle() {
return xTaskGetCurrentTaskHandle();
}
size_t TaskManagement::getTaskStackHighWatermark(
TaskHandle_t task) {
return uxTaskGetStackHighWaterMark(task) * sizeof(StackType_t);
2020-08-25 12:40:06 +02:00
}