1
0
forked from fsfw/fsfw

added retvals for mutex

This commit is contained in:
2020-05-29 14:02:14 +02:00
parent cb14ec15b5
commit 8f563b7b21
2 changed files with 23 additions and 20 deletions

View File

@ -1,22 +1,27 @@
#ifndef OS_RTEMS_MUTEX_H_
#define OS_RTEMS_MUTEX_H_
#ifndef FRAMEWORK_FREERTOS_MUTEX_H_
#define FRAMEWORK_FREERTOS_MUTEX_H_
#include <framework/ipc/MutexIF.h>
#include <freertos/FreeRTOS.h>
#include <freertos/semphr.h>
#include <FreeRTOS.h>
#include "semphr.h"
/**
* @brief OS component to implement MUTual EXclusion
*
* @details
* Mutexes are binary semaphores which include a priority inheritance mechanism.
* Documentation: https://www.freertos.org/Real-time-embedded-RTOS-mutexes.html
* @ingroup osal
*/
class Mutex : public MutexIF {
public:
Mutex();
~Mutex();
ReturnValue_t lockMutex(uint32_t timeoutMs);
ReturnValue_t unlockMutex();
ReturnValue_t lockMutex(uint32_t timeoutMs) override;
ReturnValue_t unlockMutex() override;
private:
SemaphoreHandle_t handle;
};
#endif /* OS_RTEMS_MUTEX_H_ */
#endif /* FRAMEWORK_FREERTOS_MUTEX_H_ */