architecture dependant call delcared external

This commit is contained in:
Robin Müller 2020-04-23 18:13:14 +02:00
parent 328737d0ad
commit fc4199c3b1
2 changed files with 8 additions and 7 deletions

View File

@ -8,15 +8,9 @@
extern "C" {
#include "FreeRTOS.h"
#include "portmacro.h"
#include "task.h"
}
/**
* TODO: This stuff is hardware and architecture and mission dependant...
* Maybe there is a better solution? The request ContextSwitch function
* could be declared external for example.
*/
void TaskManagement::requestContextSwitchFromTask() {
vTaskDelay(0);
}
@ -24,7 +18,7 @@ void TaskManagement::requestContextSwitchFromTask() {
void TaskManagement::requestContextSwitch(CallContext callContext = CallContext::task) {
if(callContext == CallContext::isr) {
// This function depends on the partmacro.h definition for the specific device
portYIELD_FROM_ISR();
requestContextSwitchFromISR();
} else {
requestContextSwitchFromTask();
}

View File

@ -7,6 +7,12 @@
#ifndef FRAMEWORK_OSAL_FREERTOS_TASKMANAGEMENT_H_
#define FRAMEWORK_OSAL_FREERTOS_TASKMANAGEMENT_H_
/**
* Architecture dependant portmacro.h function call.
* Should be implemented in bsp.
*/
extern "C" void requestContextSwitchFromISR();
/*!
* Used by functions to tell if they are being called from
* within an ISR or from a regular task. This is required because FreeRTOS
@ -18,6 +24,7 @@ enum CallContext {
isr = 0xFF //!< isr_context
};
class TaskManagement {
public:
/**