C++ conversions (#111)
* Remove version from artifact name * Target C++ 20 and higher * Use cpp string * Better crash implementation * String utils in cpp style * Replace parameter methods with start() method * MutexType to Mutex::Type * Kernel c to cpp style * Cleanup event flag * More cpp conversions * Test fixes * Updated ideas docs
This commit is contained in:
committed by
GitHub
parent
d52fe52d96
commit
42e843b463
@@ -14,21 +14,27 @@ namespace tt {
|
||||
|
||||
class ScopedMutexUsage;
|
||||
|
||||
typedef enum {
|
||||
MutexTypeNormal,
|
||||
MutexTypeRecursive,
|
||||
} MutexType;
|
||||
|
||||
/**
|
||||
* Wrapper for FreeRTOS xSemaphoreCreateMutex and xSemaphoreCreateRecursiveMutex
|
||||
* Can be used in IRQ mode (within ISR context)
|
||||
*/
|
||||
class Mutex {
|
||||
private:
|
||||
SemaphoreHandle_t semaphore;
|
||||
MutexType type;
|
||||
|
||||
public:
|
||||
explicit Mutex(MutexType type = MutexTypeNormal);
|
||||
|
||||
enum Type {
|
||||
TypeNormal,
|
||||
TypeRecursive,
|
||||
};
|
||||
|
||||
private:
|
||||
|
||||
SemaphoreHandle_t semaphore;
|
||||
Type type;
|
||||
|
||||
public:
|
||||
|
||||
explicit Mutex(Type type = TypeNormal);
|
||||
~Mutex();
|
||||
|
||||
TtStatus acquire(uint32_t timeout) const;
|
||||
@@ -68,7 +74,7 @@ public:
|
||||
*/
|
||||
|
||||
[[deprecated("use class")]]
|
||||
Mutex* tt_mutex_alloc(MutexType type);
|
||||
Mutex* tt_mutex_alloc(Mutex::Type type);
|
||||
|
||||
/** Free Mutex
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user