2021-07-14 00:54:39 +02:00
|
|
|
#include "fsfw/osal/freertos/TaskManagement.h"
|
2020-09-18 13:15:14 +02:00
|
|
|
|
2022-02-02 10:29:30 +01:00
|
|
|
void TaskManagement::vRequestContextSwitchFromTask() { vTaskDelay(0); }
|
2020-09-18 13:15:14 +02:00
|
|
|
|
2022-02-02 10:29:30 +01:00
|
|
|
void TaskManagement::requestContextSwitch(CallContext callContext = CallContext::TASK) {
|
|
|
|
if (callContext == CallContext::ISR) {
|
|
|
|
// This function depends on the partmacro.h definition for the specific device
|
|
|
|
vRequestContextSwitchFromISR();
|
|
|
|
} else {
|
|
|
|
vRequestContextSwitchFromTask();
|
|
|
|
}
|
2020-09-18 13:15:14 +02:00
|
|
|
}
|
|
|
|
|
2022-02-02 10:29:30 +01:00
|
|
|
TaskHandle_t TaskManagement::getCurrentTaskHandle() { return xTaskGetCurrentTaskHandle(); }
|
2020-09-18 13:15:14 +02:00
|
|
|
|
2022-02-02 10:29:30 +01:00
|
|
|
size_t TaskManagement::getTaskStackHighWatermark(TaskHandle_t task) {
|
|
|
|
return uxTaskGetStackHighWaterMark(task) * sizeof(StackType_t);
|
2020-09-18 13:15:14 +02:00
|
|
|
}
|