12 #if __has_include(<ma_config_board.h>)
13 #include <ma_config_board.h>
15 #error "No <ma_config_board.h>"
20 #elif MA_OSAL_FREERTOS
23 #error "No OSAL defined"
42 Thread(
const char* name,
void (*entry)(
void*),
void* arg =
nullptr, uint32_t priority = 0,
size_t stacksize = 0,
ma_stack_t* stack =
nullptr) noexcept;
44 operator
bool() const;
45 bool start(
void* arg =
nullptr);
48 bool operator==(const
Thread& other) const;
66 static void* threadEntryPointStub(
void* arg);
67 #elif MA_OSAL_FREERTOS
68 static void threadEntryPointStub(
void* arg);
73 void (*m_entry)(
void*);
82 Mutex(
bool recursive =
true) noexcept;
84 operator
bool() const;
103 operator
bool() const;
106 const
Mutex& m_mutex;
113 operator
bool() const;
115 uint32_t getCount() const;
131 operator
bool() const;
132 bool wait(uint32_t mask, uint32_t* value,
ma_tick_t timeout =
Tick::waitForever,
bool clear = true,
bool waitAll = false);
133 void clear(uint32_t value = 0xffffffffu);
134 void set(uint32_t value);
135 uint32_t get() const;
150 operator
bool() const;
166 Timer(uint32_t ms,
void (*fn)(
ma_timer_t*,
void*),
void* arg,
bool oneshot =
false) noexcept;
168 operator
bool() const;
183 static void install(std::vector<int> sigs, std::function<
void(
int sig)> callback);
186 static void sigHandler(
int sig);
189 static std::map<int, std::vector<std::function<void(
int sig)>>> s_callbacks;
190 static Mutex m_mutex;
Definition: ma_osal.h:127
Guard(const Mutex &mutex) noexcept
Definition: ma_osal.h:146
MessageBox(size_t size=1) noexcept
Mutex(bool recursive=true) noexcept
bool tryLock(ma_tick_t timeout=Tick::waitForever)
Definition: ma_osal.h:109
Semaphore(size_t count=0) noexcept
Definition: ma_osal.h:181
static void install(std::vector< int > sigs, std::function< void(int sig)> callback)
static void exitCritical()
bool start(void *arg=nullptr)
static void enterCritical()
virtual void threadEntryPoint(void)
static void sleep(ma_tick_t tick)
static ma_thread_t * self()
Thread(const char *name, void(*entry)(void *), void *arg=nullptr, uint32_t priority=0, size_t stacksize=0, ma_stack_t *stack=nullptr) noexcept
static ma_tick_t fromSeconds(uint32_t sec)
static uint32_t toMilliseconds(ma_tick_t tick)
static uint32_t toMicroseconds(ma_tick_t tick)
static uint32_t toSeconds(ma_tick_t tick)
static ma_tick_t current()
static ma_tick_t fromMilliseconds(uint32_t ms)
static const ma_tick_t waitForever
Definition: ma_osal.h:37
static ma_tick_t fromMicroseconds(uint32_t us)
Definition: ma_osal.h:164
Timer(uint32_t ms, void(*fn)(ma_timer_t *, void *), void *arg, bool oneshot=false) noexcept
#define MA_WAIT_FOREVER
Definition: ma_osal_pthread.h:14
void * ma_stack_t
Definition: ma_osal_pthread.h:19
pthread_t ma_thread_t
Definition: ma_osal_pthread.h:17
pthread_mutex_t ma_mutex_t
Definition: ma_osal_pthread.h:18
uint64_t ma_tick_t
Definition: ma_osal_pthread.h:16
Definition: ma_osal_pthread.h:26
Definition: ma_osal_pthread.h:31
Definition: ma_osal_pthread.h:21
Definition: ma_osal_pthread.h:40