1
0
forked from fsfw/fsfw

retval fix, unittest running again

This commit is contained in:
2020-05-29 03:03:48 +02:00
parent 3d2935ac69
commit da403c01d0
5 changed files with 94 additions and 112 deletions

View File

@ -43,7 +43,16 @@ public:
ReturnValue_t release() override;
uint8_t getSemaphoreCounter() const override;
static uint8_t getSemaphoreCounterFromISR(TaskHandle_t task);
/**
* Get the semaphore counter from an ISR.
* @param task
* @param higherPriorityTaskWoken This will be set to pdPASS if a task with
* a higher priority was unblocked. A context switch should be requested
* from an ISR if this is the case (see TaskManagement functions)
* @return
*/
static uint8_t getSemaphoreCounterFromISR(TaskHandle_t task,
BaseType_t* higherPriorityTaskWoken);
/**
* Acquire with a timeout value in ticks
@ -71,6 +80,9 @@ public:
/**
* Release seamphore of a task from an ISR.
* @param taskToNotify
* @param higherPriorityTaskWoken This will be set to pdPASS if a task with
* a higher priority was unblocked. A context switch should be requested
* from an ISR if this is the case (see TaskManagement functions)
* @return -@c RETURN_OK on success
* -@c SemaphoreIF::SEMAPHORE_NOT_OWNED if #maxCount semaphores are
* already available.
@ -78,10 +90,11 @@ public:
static ReturnValue_t releaseFromISR(TaskHandle_t taskToNotify,
BaseType_t* higherPriorityTaskWoken);
uint8_t getMaxCount() const;
private:
TaskHandle_t handle;
const uint8_t maxCount;
uint8_t currentCount = 0;
};
#endif /* FRAMEWORK_OSAL_FREERTOS_COUNTINGSEMAPHUSINGTASK_H_ */