2020-02-26 16:55:35 +01:00
|
|
|
/**
|
|
|
|
* @file TaskManagement.cpp
|
|
|
|
*
|
|
|
|
* @date 26.02.2020
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
#include <framework/osal/FreeRTOS/TaskManagement.h>
|
|
|
|
#include <FreeRTOS.h>
|
|
|
|
#include "portmacro.h"
|
|
|
|
#include "task.h"
|
|
|
|
|
2020-02-28 22:55:25 +01:00
|
|
|
void TaskManagement::requestContextSwitchFromTask() {
|
2020-02-26 16:55:35 +01:00
|
|
|
vTaskDelay(0);
|
|
|
|
}
|
|
|
|
|
2020-02-28 22:55:25 +01:00
|
|
|
void TaskManagement::requestContextSwitch(SystemContext callContext = SystemContext::task_context) {
|
2020-02-26 16:55:35 +01:00
|
|
|
if(callContext == SystemContext::isr_context) {
|
|
|
|
// This function depends on the partmacro.h definition for the specific device
|
|
|
|
portYIELD_FROM_ISR();
|
|
|
|
} else {
|
|
|
|
requestContextSwitchFromTask();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-02-28 22:55:25 +01:00
|
|
|
|
|
|
|
|