 |
Firmware
0.4.1
|
Loading...
Searching...
No Matches
Go to the documentation of this file.
27#define CONCAT_DETAIL(A, B) A##B
28#define CONCAT(A, B) CONCAT_DETAIL(A, B)
36#define COMMON_TASK_MEMBERS(NAME, PRIORITY, CORE_ID, TIMEOUT) \
37 static constexpr char const* name{NAME}; \
38 static constexpr UBaseType_t priority{PRIORITY}; \
39 static constexpr BaseType_t core_id{CORE_ID}; \
40 static constexpr TickType_t timeout{TIMEOUT}; \
41 static inline StaticTask_t tcb{}; \
42 static inline TaskFunction_t function{NULL}; \
43 static inline TaskHandle_t handle{NULL}; \
44 static void create(TaskFunction_t f = function) { \
45 handle = xTaskCreateStaticPinnedToCore(function = f, \
54 static void destroy() { \
55 vTaskDelete(handle); \
58 static void resume() { vTaskResume(handle); } \
59 static void suspend() { vTaskSuspend(handle); }
69#define TASK(OBJECT, NAME, STACK_SIZE, PRIORITY, CORE_ID, TIMEOUT) \
70 struct CONCAT(Task, __LINE__) { \
71 static inline std::array<StackType_t, STACK_SIZE> stack{}; \
72 COMMON_TASK_MEMBERS(NAME, PRIORITY, CORE_ID, TIMEOUT) \
82#define SHARED_TASK(OBJECT, NAME, PRIORITY, CORE_ID, TIMEOUT) \
83 struct CONCAT(SharedTask, __LINE__) { \
84 COMMON_TASK_MEMBERS(NAME, PRIORITY, CORE_ID, TIMEOUT) \