1
0
forked from fsfw/fsfw

extended task management for freeRTOS

This commit is contained in:
2020-05-01 16:47:53 +02:00
parent 15c03863c0
commit 281da25bf9
6 changed files with 63 additions and 38 deletions

View File

@ -1,7 +1,14 @@
#ifndef FRAMEWORK_OSAL_FREERTOS_TASKMANAGEMENT_H_
#define FRAMEWORK_OSAL_FREERTOS_TASKMANAGEMENT_H_
// maybe this can be part of the TaskFactory.cpp
#include <framework/returnvalues/HasReturnvaluesIF.h>
extern "C" {
#include "FreeRTOS.h"
#include "task.h"
}
#include <cstdint>
/**
* Architecture dependant portmacro.h function call.
* Should be implemented in bsp.
@ -35,6 +42,29 @@ public:
* can be requested manually by calling this function.
*/
static void requestContextSwitchFromTask(void);
/**
* @return The current task handle
*/
static TaskHandle_t getCurrentTaskHandle();
/**
* Get returns the minimum amount of remaining stack space in words
* that was a available to the task since the task started executing.
* Please note that the actual value in bytes depends
* on the stack depth type.
* E.g. on a 32 bit machine, a value of 200 means 800 bytes.
* @return Smallest value of stack remaining since the task was started in
* words.
*/
static configSTACK_DEPTH_TYPE getTaskStackHighWatermark();
/**
* Function to be called to delay current task
* @param delay The delay in milliseconds
* @return Success of deletion
*/
static ReturnValue_t delayTask(uint32_t delayMs);
};
#endif /* FRAMEWORK_OSAL_FREERTOS_TASKMANAGEMENT_H_ */