8 #ifndef MAIN_FREERTOS_H_
9 #define MAIN_FREERTOS_H_
13 #include <freertos/FreeRTOS.h>
14 #include <freertos/task.h>
15 #include <freertos/semphr.h>
23 static void sleep(uint32_t ms);
24 static void startTask(
void task(
void *), std::string taskName,
void *param=
nullptr,
int stackSize = 2048);
25 static void deleteTask(TaskHandle_t pTask =
nullptr);
31 Semaphore(std::string owner =
"<Unknown>");
35 void give(uint32_t value);
36 void setName(std::string name);
37 void take(std::string owner=
"<Unknown>");
38 void take(uint32_t timeoutMs, std::string owner=
"<Unknown>");
39 uint32_t
wait(std::string owner=
"<Unknown>");
40 std::string toString();
42 SemaphoreHandle_t m_semaphore;
static void startTask(void task(void *), std::string taskName, void *param=nullptr, int stackSize=2048)
Definition: FreeRTOS.cpp:34
uint32_t wait(std::string owner="<Unknown>")
Wait for a semaphore to be released by trying to take it and then releasing it again.
Definition: FreeRTOS.cpp:77
void give()
Give a semaphore. The Semaphore is given.
Definition: FreeRTOS.cpp:103
static void sleep(uint32_t ms)
Definition: FreeRTOS.cpp:22
void giveFromISR()
Give a semaphore from an ISR.
Definition: FreeRTOS.cpp:124
static void deleteTask(TaskHandle_t pTask=nullptr)
Definition: FreeRTOS.cpp:43
Definition: FreeRTOS.h:29
static uint32_t getTimeSinceStart()
Definition: FreeRTOS.cpp:52
void take(std::string owner="<Unknown>")
Take a semaphore. Take a semaphore and wait indefinitely.
Definition: FreeRTOS.cpp:134
Interface to FreeRTOS functions.
Definition: FreeRTOS.h:21