37#ifndef __ARM_ARCH_6M__
38 #define __ARM_ARCH_6M__ 0
40#ifndef __ARM_ARCH_7M__
41 #define __ARM_ARCH_7M__ 0
43#ifndef __ARM_ARCH_7EM__
44 #define __ARM_ARCH_7EM__ 0
46#ifndef __ARM_ARCH_8M_MAIN__
47 #define __ARM_ARCH_8M_MAIN__ 0
49#ifndef __ARM_ARCH_7A__
50 #define __ARM_ARCH_7A__ 0
53#if ((__ARM_ARCH_7M__ == 1U) || \
54 (__ARM_ARCH_7EM__ == 1U) || \
55 (__ARM_ARCH_8M_MAIN__ == 1U))
56#define IS_IRQ_MASKED() ((__get_PRIMASK() != 0U) || (__get_BASEPRI() != 0U))
57#elif (__ARM_ARCH_6M__ == 1U)
58#define IS_IRQ_MASKED() (__get_PRIMASK() != 0U)
59#elif (__ARM_ARCH_7A__ == 1U)
61#define CPSR_MASKBIT_I 0x80U
63#define IS_IRQ_MASKED() ((__get_CPSR() & CPSR_MASKBIT_I) != 0U)
65#define IS_IRQ_MASKED() (__get_PRIMASK() != 0U)
68#if (__ARM_ARCH_7A__ == 1U)
70#define CPSR_MODE_USER 0x10U
71#define CPSR_MODE_SYSTEM 0x1FU
73#define IS_IRQ_MODE() ((__get_mode() != CPSR_MODE_USER) && (__get_mode() != CPSR_MODE_SYSTEM))
75#define IS_IRQ_MODE() (__get_IPSR() != 0U)
79#define MAX_BITS_TASK_NOTIFY 31U
80#define MAX_BITS_EVENT_GROUPS 24U
82#define THREAD_FLAGS_INVALID_BITS (~((1UL << MAX_BITS_TASK_NOTIFY) - 1U))
83#define EVENT_FLAGS_INVALID_BITS (~((1UL << MAX_BITS_EVENT_GROUPS) - 1U))
86#define KERNEL_VERSION (((uint32_t)tskKERNEL_VERSION_MAJOR * 10000000UL) | \
87 ((uint32_t)tskKERNEL_VERSION_MINOR * 10000UL) | \
88 ((uint32_t)tskKERNEL_VERSION_BUILD * 1UL))
90#define KERNEL_ID ("FreeRTOS " tskKERNEL_VERSION_NUMBER)
103#if (configUSE_TICKLESS_IDLE == 0)
120#if defined(USE_FreeRTOS_HEAP_5)
121#if (configAPPLICATION_ALLOCATED_HEAP == 0)
128 #define HEAP_5_REGION_SETUP 1
130 #ifndef configHEAP_5_REGIONS
131 #define configHEAP_5_REGIONS xHeapRegions
148 #define HEAP_5_REGION_SETUP 0
153#undef SysTick_Handler
156extern void SysTick_Handler (
void);
163#if (USE_CUSTOM_SYSTICK_HANDLER_IMPLEMENTATION == 0)
164void SysTick_Handler (
void) {
165#if (configUSE_TICKLESS_IDLE == 0)
182#if (__ARM_ARCH_7A__ == 0U)
193#ifndef uxSemaphoreGetCountFromISR
194#define uxSemaphoreGetCountFromISR( xSemaphore ) uxQueueMessagesWaitingFromISR( ( QueueHandle_t ) ( xSemaphore ) )
229#if (__ARM_ARCH_7A__ == 1U)
230 return (__get_CNTFRQ() - PL1_GetCurrentValue());
237#if (configUSE_TICKLESS_IDLE == 0)
240#if (__ARM_ARCH_7A__ == 1U)
241 CNTP_CTL_Type cntp_ctl;
242 cntp_ctl.w = PL1_GetControl();
243 return (cntp_ctl.b.ISTATUS);
245 return ((
SysTick->CTRL >> 16) & 1U);
252#if (__ARM_ARCH_7A__ == 1U)
253 return (__get_CNTFRQ() + 1U);
276 #if defined(USE_TRACE_EVENT_RECORDER)
278 EvrFreeRTOSSetup(0U);
280 #if defined(USE_FreeRTOS_HEAP_5) && (HEAP_5_REGION_SETUP == 1)
300 if (version !=
NULL) {
306 if ((id_buf !=
NULL) && (id_size != 0U)) {
519#if (configUSE_TICKLESS_IDLE != 0)
537#if (configUSE_TICKLESS_IDLE != 0)
629 #if (configSUPPORT_STATIC_ALLOCATION == 1)
636 #if (configSUPPORT_DYNAMIC_ALLOCATION == 1)
777#if (configUSE_OS2_THREAD_SUSPEND_RESUME == 1)
788 else if (hTask ==
NULL) {
810 else if (hTask ==
NULL) {
827#ifndef USE_FreeRTOS_HEAP_1
839#ifndef USE_FreeRTOS_HEAP_1
845 else if (hTask ==
NULL) {
882#if (configUSE_OS2_THREAD_ENUMERATE == 1)
890 if ((
IRQ_Context() != 0U) || (thread_array ==
NULL) || (array_items == 0U)) {
904 for (i = 0U; (i <
count) && (i < array_items); i++) {
922#if (configUSE_OS2_THREAD_FLAGS == 1)
959 uint32_t rflags, cflags;
1012uint32_t
osThreadFlagsWait (uint32_t flags, uint32_t options, uint32_t timeout) {
1013 uint32_t rflags, nval;
1043 if ((flags & rflags) == flags) {
1046 if (timeout == 0U) {
1053 if ((flags & rflags) != 0) {
1056 if (timeout == 0U) {
1069 tout = timeout - td;
1150#if (configUSE_OS2_TIMER == 1)
1161 if (callb !=
NULL) {
1183 #if (configSUPPORT_STATIC_ALLOCATION == 1)
1193 #if (configSUPPORT_DYNAMIC_ALLOCATION == 1)
1196 if (callb ==
NULL) {
1199 if (callb !=
NULL) {
1206 if (callb !=
NULL) {
1208 callb->
arg = argument;
1245 #if (configSUPPORT_STATIC_ALLOCATION == 1)
1246 hTimer = xTimerCreateStatic (name, 1, reload, callb, TimerCallback, (
StaticTimer_t *)attr->
cb_mem);
1251 #if (configSUPPORT_DYNAMIC_ALLOCATION == 1)
1252 hTimer = xTimerCreate (name, 1, reload, callb, TimerCallback);
1257 #if (configSUPPORT_DYNAMIC_ALLOCATION == 1)
1258 if ((hTimer ==
NULL) && (callb !=
NULL) && (callb_dyn == 1U)) {
1299 else if ((hTimer ==
NULL) || (ticks == 0U)) {
1324 else if (hTimer ==
NULL) {
1367#ifndef USE_FreeRTOS_HEAP_1
1368#if (configSUPPORT_DYNAMIC_ALLOCATION == 1)
1375 else if (hTimer ==
NULL) {
1379 #if (configSUPPORT_DYNAMIC_ALLOCATION == 1)
1384 #if (configSUPPORT_DYNAMIC_ALLOCATION == 1)
1385 if ((uint32_t)callb & 1U) {
1442 #if (configSUPPORT_STATIC_ALLOCATION == 1)
1443 hEventGroup = xEventGroupCreateStatic (attr->
cb_mem);
1448 #if (configSUPPORT_DYNAMIC_ALLOCATION == 1)
1449 hEventGroup = xEventGroupCreate();
1474 #if (configUSE_OS2_EVENTFLAGS_FROM_ISR == 0)
1513 #if (configUSE_OS2_EVENTFLAGS_FROM_ISR == 0)
1548 if (ef_id ==
NULL) {
1579 if (timeout == 0U) {
1603 if ((flags & rflags) != flags) {
1612 if ((flags & rflags) == 0U) {
1633#ifndef USE_FreeRTOS_HEAP_1
1637 else if (hEventGroup ==
NULL) {
1655#if (configUSE_OS2_MUTEX == 1)
1704 #if (configSUPPORT_STATIC_ALLOCATION == 1)
1706 #if (configUSE_RECURSIVE_MUTEXES == 1)
1707 hMutex = xSemaphoreCreateRecursiveMutexStatic (attr->
cb_mem);
1711 hMutex = xSemaphoreCreateMutexStatic (attr->
cb_mem);
1717 #if (configSUPPORT_DYNAMIC_ALLOCATION == 1)
1719 #if (configUSE_RECURSIVE_MUTEXES == 1)
1720 hMutex = xSemaphoreCreateRecursiveMutex ();
1723 hMutex = xSemaphoreCreateMutex ();
1729 #if (configQUEUE_REGISTRY_SIZE > 0)
1730 if (hMutex !=
NULL) {
1738 if ((hMutex !=
NULL) && (rmtx != 0U)) {
1760 rmtx = (uint32_t)mutex_id & 1U;
1767 else if (hMutex ==
NULL) {
1772 #if (configUSE_RECURSIVE_MUTEXES == 1)
1773 if (xSemaphoreTakeRecursive (hMutex, timeout) !=
pdPASS) {
1774 if (timeout != 0U) {
1784 if (timeout != 0U) {
1808 rmtx = (uint32_t)mutex_id & 1U;
1815 else if (hMutex ==
NULL) {
1820 #if (configUSE_RECURSIVE_MUTEXES == 1)
1821 if (xSemaphoreGiveRecursive (hMutex) !=
pdPASS) {
1861#ifndef USE_FreeRTOS_HEAP_1
1869 else if (hMutex ==
NULL) {
1873 #if (configQUEUE_REGISTRY_SIZE > 0)
1900 if ((
IRQ_Context() == 0U) && (max_count > 0U) && (initial_count <= max_count)) {
1920 if (max_count == 1U) {
1922 #if (configSUPPORT_STATIC_ALLOCATION == 1)
1927 #if (configSUPPORT_DYNAMIC_ALLOCATION == 1)
1928 hSemaphore = xSemaphoreCreateBinary();
1932 if ((hSemaphore !=
NULL) && (initial_count != 0U)) {
1941 #if (configSUPPORT_STATIC_ALLOCATION == 1)
1946 #if (configSUPPORT_DYNAMIC_ALLOCATION == 1)
1947 hSemaphore = xSemaphoreCreateCounting (max_count, initial_count);
1952 #if (configQUEUE_REGISTRY_SIZE > 0)
1953 if (hSemaphore !=
NULL) {
1977 if (hSemaphore ==
NULL) {
1981 if (timeout != 0U) {
1996 if (timeout != 0U) {
2018 if (hSemaphore ==
NULL) {
2047 if (hSemaphore ==
NULL) {
2067#ifndef USE_FreeRTOS_HEAP_1
2071 else if (hSemaphore ==
NULL) {
2075 #if (configQUEUE_REGISTRY_SIZE > 0)
2106 if ((
IRQ_Context() == 0U) && (msg_count > 0U) && (msg_size > 0U)) {
2128 #if (configSUPPORT_STATIC_ALLOCATION == 1)
2129 hQueue = xQueueCreateStatic (msg_count, msg_size, attr->
mq_mem, attr->
cb_mem);
2134 #if (configSUPPORT_DYNAMIC_ALLOCATION == 1)
2135 hQueue = xQueueCreate (msg_count, msg_size);
2140 #if (configQUEUE_REGISTRY_SIZE > 0)
2141 if (hQueue !=
NULL) {
2171 if ((hQueue ==
NULL) || (msg_ptr ==
NULL) || (timeout != 0U)) {
2185 if ((hQueue ==
NULL) || (msg_ptr ==
NULL)) {
2190 if (timeout != 0U) {
2219 if ((hQueue ==
NULL) || (msg_ptr ==
NULL) || (timeout != 0U)) {
2233 if ((hQueue ==
NULL) || (msg_ptr ==
NULL)) {
2238 if (timeout != 0U) {
2294 if (hQueue ==
NULL) {
2305 return ((uint32_t)
count);
2345 else if (hQueue ==
NULL) {
2364#ifndef USE_FreeRTOS_HEAP_1
2368 else if (hQueue ==
NULL) {
2372 #if (configQUEUE_REGISTRY_SIZE > 0)
2390#ifdef FREERTOS_MPOOL_H_
2392static void FreeBlock (
MemPool_t *mp,
void *block);
2394static void *CreateBlock (
MemPool_t *mp);
2402 int32_t mem_cb, mem_mp;
2408 else if ((block_count == 0U) || (block_size == 0U)) {
2440 if (((uint32_t)attr->
mp_mem & 3U) == 0U) {
2464 #if (configSUPPORT_STATIC_ALLOCATION == 1)
2465 mp->
sem = xSemaphoreCreateCountingStatic (block_count, block_count, &mp->mem_sem);
2466 #elif (configSUPPORT_DYNAMIC_ALLOCATION == 1)
2467 mp->
sem = xSemaphoreCreateCounting (block_count, block_count);
2487 mp->
bl_sz = block_size;
2488 mp->
bl_cnt = block_count;
2505 if ((mem_cb == 0) && (mp !=
NULL)) {
2527 else if (mp_id ==
NULL) {
2546 if (mp_id ==
NULL) {
2557 if (timeout == 0U) {
2563 block = AllocBlock(mp);
2565 if (block ==
NULL) {
2567 block = CreateBlock(mp);
2581 block = AllocBlock(mp);
2583 if (block ==
NULL) {
2585 block = CreateBlock(mp);
2608 if ((mp_id ==
NULL) || (block ==
NULL)) {
2634 FreeBlock(mp, block);
2651 FreeBlock(mp, block);
2672 if (mp_id ==
NULL) {
2699 if (mp_id ==
NULL) {
2726 if (mp_id ==
NULL) {
2759 if (mp_id ==
NULL) {
2790 if (mp_id ==
NULL) {
2812 if ((mp->
status & 2U) != 0U) {
2816 if ((mp->
status & 1U) != 0U) {
2833static void *CreateBlock (
MemPool_t *mp) {
2850static void *AllocBlock (
MemPool_t *mp) {
2867static void FreeBlock (
MemPool_t *mp,
void *block) {
2887#if (configUSE_IDLE_HOOK == 1)
2894#if (configUSE_TICK_HOOK == 1)
2895 __WEAK void vApplicationTickHook (
void){}
2901#if (configUSE_MALLOC_FAILED_HOOK == 1)
2911#if (configUSE_DAEMON_TASK_STARTUP_HOOK == 1)
2918#if (configCHECK_FOR_STACK_OVERFLOW > 0)
2929#if (configSUPPORT_STATIC_ALLOCATION == 1)
2934__WEAK void vApplicationGetIdleTaskMemory (
StaticTask_t **ppxIdleTaskTCBBuffer,
StackType_t **ppxIdleTaskStackBuffer, uint32_t *pulIdleTaskStackSize) {
2939 *ppxIdleTaskTCBBuffer = &Idle_TCB;
2940 *ppxIdleTaskStackBuffer = &Idle_Stack[0];
2948__WEAK void vApplicationGetTimerTaskMemory (
StaticTask_t **ppxTimerTaskTCBBuffer,
StackType_t **ppxTimerTaskStackBuffer, uint32_t *pulTimerTaskStackSize) {
2953 *ppxTimerTaskTCBBuffer = &Timer_TCB;
2954 *ppxTimerTaskStackBuffer = &Timer_Stack[0];
#define configTICK_RATE_HZ
#define configMINIMAL_STACK_SIZE
#define configTOTAL_HEAP_SIZE
#define configCPU_CLOCK_HZ
#define configTIMER_TASK_STACK_DEPTH
struct xSTATIC_QUEUE StaticQueue_t
#define vQueueAddToRegistry(xQueue, pcName)
StaticQueue_t StaticSemaphore_t
struct xSTATIC_TIMER StaticTimer_t
#define configSTACK_DEPTH_TYPE
struct xSTATIC_TCB StaticTask_t
#define vQueueUnregisterQueue(xQueue)
struct xSTATIC_EVENT_GROUP StaticEventGroup_t
static osThreadId_t volatile owner
static std::atomic< bool > running
CMSIS compiler generic header file.
osStatus_t osSemaphoreRelease(osSemaphoreId_t semaphore_id)
Release a Semaphore token up to the initial maximum count.
osPriority_t osThreadGetPriority(osThreadId_t thread_id)
Get current priority of a thread.
osMessageQueueId_t osMessageQueueNew(uint32_t msg_count, uint32_t msg_size, const osMessageQueueAttr_t *attr)
Create and Initialize a Message Queue object.
osSemaphoreId_t osSemaphoreNew(uint32_t max_count, uint32_t initial_count, const osSemaphoreAttr_t *attr)
Create and Initialize a Semaphore object.
#define EVENT_FLAGS_INVALID_BITS
osStatus_t osThreadTerminate(osThreadId_t thread_id)
Terminate execution of a thread.
uint32_t osEventFlagsSet(osEventFlagsId_t ef_id, uint32_t flags)
Set the specified Event Flags.
static osKernelState_t KernelState
__STATIC_INLINE void SVC_Setup(void)
osStatus_t osDelayUntil(uint32_t ticks)
Wait until specified time.
osStatus_t osThreadResume(osThreadId_t thread_id)
Resume execution of a thread.
static uint32_t OS_Tick_GetOverflow(void)
osKernelState_t osKernelGetState(void)
Get the current RTOS Kernel state.
osThreadId_t osThreadNew(osThreadFunc_t func, void *argument, const osThreadAttr_t *attr)
Create a thread and add it to Active Threads.
uint32_t osThreadGetCount(void)
Get number of active threads.
uint32_t osKernelGetSysTimerFreq(void)
Get the RTOS kernel system timer frequency.
uint32_t osEventFlagsWait(osEventFlagsId_t ef_id, uint32_t flags, uint32_t options, uint32_t timeout)
Wait for one or more Event Flags to become signaled.
static uint32_t OS_Tick_GetCount(void)
uint32_t osThreadEnumerate(osThreadId_t *thread_array, uint32_t array_items)
Enumerate active threads.
uint32_t osMessageQueueGetCount(osMessageQueueId_t mq_id)
Get number of queued messages in a Message Queue.
osStatus_t osKernelGetInfo(osVersion_t *version, char *id_buf, uint32_t id_size)
Get RTOS Kernel Information.
uint32_t osSemaphoreGetCount(osSemaphoreId_t semaphore_id)
Get current Semaphore token count.
uint32_t osKernelGetTickFreq(void)
Get the RTOS kernel tick frequency.
osStatus_t osEventFlagsDelete(osEventFlagsId_t ef_id)
Delete an Event Flags object.
osStatus_t osSemaphoreAcquire(osSemaphoreId_t semaphore_id, uint32_t timeout)
Acquire a Semaphore token or timeout if no tokens are available.
osStatus_t osSemaphoreDelete(osSemaphoreId_t semaphore_id)
Delete a Semaphore object.
uint32_t osKernelGetTickCount(void)
Get the RTOS kernel tick count.
osStatus_t osThreadSetPriority(osThreadId_t thread_id, osPriority_t priority)
Change priority of a thread.
uint32_t osEventFlagsGet(osEventFlagsId_t ef_id)
Get the current Event Flags.
osThreadId_t osThreadGetId(void)
Return the thread ID of the current running thread.
uint32_t osEventFlagsClear(osEventFlagsId_t ef_id, uint32_t flags)
Clear the specified Event Flags.
int32_t osKernelLock(void)
Lock the RTOS Kernel scheduler.
uint32_t osMessageQueueGetMsgSize(osMessageQueueId_t mq_id)
Get maximum message size in a Message Queue.
void vApplicationIdleHook(void)
osStatus_t osKernelStart(void)
Start the RTOS Kernel scheduler.
uint32_t osThreadGetStackSpace(osThreadId_t thread_id)
Get available stack space of a thread based on stack watermark recording during execution.
osStatus_t osMessageQueuePut(osMessageQueueId_t mq_id, const void *msg_ptr, uint8_t msg_prio, uint32_t timeout)
Put a Message into a Queue or timeout if Queue is full.
osStatus_t osThreadSuspend(osThreadId_t thread_id)
Suspend execution of a thread.
osEventFlagsId_t osEventFlagsNew(const osEventFlagsAttr_t *attr)
Create and Initialize an Event Flags object.
#define THREAD_FLAGS_INVALID_BITS
void vApplicationMallocFailedHook(void)
void vApplicationDaemonTaskStartupHook(void)
osStatus_t osMessageQueueDelete(osMessageQueueId_t mq_id)
Delete a Message Queue object.
uint32_t osMessageQueueGetCapacity(osMessageQueueId_t mq_id)
Get maximum number of messages in a Message Queue.
const char * osThreadGetName(osThreadId_t thread_id)
Get name of a thread.
osStatus_t osMessageQueueReset(osMessageQueueId_t mq_id)
Reset a Message Queue to initial empty state.
osThreadState_t osThreadGetState(osThreadId_t thread_id)
Get current thread state of a thread.
__STATIC_INLINE uint32_t IRQ_Context(void)
osStatus_t osThreadYield(void)
Pass control to next thread that is in state READY.
static uint32_t OS_Tick_GetInterval(void)
osStatus_t osMessageQueueGet(osMessageQueueId_t mq_id, void *msg_ptr, uint8_t *msg_prio, uint32_t timeout)
Get a Message from a Queue or timeout if Queue is empty.
__NO_RETURN void osThreadExit(void)
Terminate execution of current running thread.
uint32_t osMessageQueueGetSpace(osMessageQueueId_t mq_id)
Get number of available slots for messages in a Message Queue.
uint32_t osKernelGetSysTimerCount(void)
Get the RTOS kernel system timer count.
int32_t osKernelRestoreLock(int32_t lock)
Restore the RTOS Kernel scheduler lock state.
osStatus_t osKernelInitialize(void)
Initialize the RTOS Kernel.
int32_t osKernelUnlock(void)
Unlock the RTOS Kernel scheduler.
osStatus_t osDelay(uint32_t ticks)
Wait for Timeout (Time Delay).
uint32_t osMemoryPoolGetSpace(osMemoryPoolId_t mp_id)
Get number of memory blocks available in a Memory Pool.
osKernelState_t
Kernel state.
@ osKernelRunning
Running.
@ osKernelInactive
Inactive.
void * osMessageQueueId_t
#define osThreadJoinable
Thread created in joinable mode.
osMemoryPoolId_t osMemoryPoolNew(uint32_t block_count, uint32_t block_size, const osMemoryPoolAttr_t *attr)
Create and Initialize a Memory Pool object.
uint32_t osThreadFlagsClear(uint32_t flags)
Clear the specified Thread Flags of current running thread.
#define osMutexRecursive
Recursive mutex.
uint32_t osTimerIsRunning(osTimerId_t timer_id)
Check if a timer is running.
osStatus_t
Status code values returned by CMSIS-RTOS functions.
@ osErrorISR
Not allowed in ISR context: the function cannot be called from interrupt service routines.
@ osErrorResource
Resource not available.
@ osErrorTimeout
Operation not completed within the timeout period.
@ osOK
Operation completed successfully.
@ osError
Unspecified RTOS error: run-time error but no other error message fits.
@ osErrorParameter
Parameter error.
uint32_t osThreadFlagsSet(osThreadId_t thread_id, uint32_t flags)
Set the specified Thread Flags of a thread.
void(* osTimerFunc_t)(void *argument)
Timer callback function.
const char * osTimerGetName(osTimerId_t timer_id)
Get name of a timer.
@ osTimerOnce
One-shot timer.
osThreadId_t osMutexGetOwner(osMutexId_t mutex_id)
Get Thread which owns a Mutex object.
uint32_t osThreadFlagsGet(void)
Get the current Thread Flags of current running thread.
#define osFlagsWaitAll
Wait for all flags.
osStatus_t osMemoryPoolDelete(osMemoryPoolId_t mp_id)
Delete a Memory Pool object.
void * osMemoryPoolAlloc(osMemoryPoolId_t mp_id, uint32_t timeout)
Allocate a memory block from a Memory Pool.
void(* osThreadFunc_t)(void *argument)
Entry point of a thread.
uint32_t osMemoryPoolGetCount(osMemoryPoolId_t mp_id)
Get number of memory blocks used in a Memory Pool.
#define osFlagsErrorParameter
osErrorParameter (-4).
#define osFlagsNoClear
Do not clear flags which have been specified to wait for.
uint32_t osMemoryPoolGetBlockSize(osMemoryPoolId_t mp_id)
Get memory block size in a Memory Pool.
const char * osMemoryPoolGetName(osMemoryPoolId_t mp_id)
Get name of a Memory Pool object.
osStatus_t osTimerStart(osTimerId_t timer_id, uint32_t ticks)
Start or restart a timer.
osMutexId_t osMutexNew(const osMutexAttr_t *attr)
Create and Initialize a Mutex object.
osStatus_t osMemoryPoolFree(osMemoryPoolId_t mp_id, void *block)
Return an allocated memory block back to a Memory Pool.
osStatus_t osMutexAcquire(osMutexId_t mutex_id, uint32_t timeout)
Acquire a Mutex or timeout if it is locked.
osStatus_t osTimerStop(osTimerId_t timer_id)
Stop a timer.
osStatus_t osMutexDelete(osMutexId_t mutex_id)
Delete a Mutex object.
uint32_t osThreadFlagsWait(uint32_t flags, uint32_t options, uint32_t timeout)
Wait for one or more Thread Flags of the current running thread to become signaled.
osStatus_t osTimerDelete(osTimerId_t timer_id)
Delete a timer.
osThreadState_t
Thread state.
@ osThreadBlocked
Blocked.
@ osThreadRunning
Running.
osPriority_t
Priority values.
@ osPriorityISR
Reserved for ISR deferred thread.
@ osPriorityNormal
Priority: normal.
@ osPriorityIdle
Reserved for Idle thread.
@ osPriorityNone
No priority (not initialized).
@ osPriorityError
System cannot determine priority or illegal priority.
osTimerId_t osTimerNew(osTimerFunc_t func, osTimerType_t type, void *argument, const osTimerAttr_t *attr)
Create and Initialize a timer.
uint32_t osMemoryPoolGetCapacity(osMemoryPoolId_t mp_id)
Get maximum number of memory blocks in a Memory Pool.
osStatus_t osMutexRelease(osMutexId_t mutex_id)
Release a Mutex that was acquired by osMutexAcquire.
#define osMutexRobust
Robust mutex.
EventBits_t xEventGroupWaitBits(EventGroupHandle_t xEventGroup, const EventBits_t uxBitsToWaitFor, const BaseType_t xClearOnExit, const BaseType_t xWaitForAllBits, TickType_t xTicksToWait)
void vEventGroupDelete(EventGroupHandle_t xEventGroup)
event_groups.h
EventBits_t xEventGroupClearBits(EventGroupHandle_t xEventGroup, const EventBits_t uxBitsToClear)
EventBits_t xEventGroupSetBits(EventGroupHandle_t xEventGroup, const EventBits_t uxBitsToSet)
EventBits_t xEventGroupGetBitsFromISR(EventGroupHandle_t xEventGroup)
#define xEventGroupGetBits(xEventGroup)
#define xEventGroupClearBitsFromISR(xEventGroup, uxBitsToClear)
#define xEventGroupSetBitsFromISR(xEventGroup, uxBitsToSet, pxHigherPriorityTaskWoken)
struct EventGroupDef_t * EventGroupHandle_t
static ActuatorControllerState state
void vApplicationStackOverflowHook(xTaskHandle xTask, char *pcTaskName)
File Name : freertos.c Description : Code for freertos applications.
#define MEMPOOL_ARR_SIZE(bl_count, bl_size)
struct MemPoolDef_t MemPool_t
#define SysTick
SysTick configuration struct.
#define __enable_irq
Enable IRQ Interrupts.
#define __disable_irq
Disable IRQ Interrupts.
@ SVCall_IRQn
11 Cortex-M SV Call Interrupt
static PRIVILEGED_DATA uint8_t ucHeap[configTOTAL_HEAP_SIZE]
size_type count(const key_type &key) const
*brief user defined string literal for JSON values *sa std::size_t n
void xPortSysTickHandler(void)
void vPortDefineHeapRegions(const HeapRegion_t *const pxHeapRegions) PRIVILEGED_FUNCTION
void vPortFree(void *pv) PRIVILEGED_FUNCTION
void * pvPortMalloc(size_t xSize) PRIVILEGED_FUNCTION
struct HeapRegion HeapRegion_t
unsigned long UBaseType_t
portSTACK_TYPE StackType_t
#define portYIELD_FROM_ISR(x)
void(* TaskFunction_t)(void *)
UBaseType_t uxQueueMessagesWaitingFromISR(const QueueHandle_t xQueue) PRIVILEGED_FUNCTION
#define xQueueSendToBackFromISR(xQueue, pvItemToQueue, pxHigherPriorityTaskWoken)
struct QueueDefinition * QueueHandle_t
void vQueueDelete(QueueHandle_t xQueue) PRIVILEGED_FUNCTION
#define xQueueSendToBack(xQueue, pvItemToQueue, xTicksToWait)
#define xQueueReset(xQueue)
UBaseType_t uxQueueSpacesAvailable(const QueueHandle_t xQueue) PRIVILEGED_FUNCTION
BaseType_t xQueueReceiveFromISR(QueueHandle_t xQueue, void *const pvBuffer, BaseType_t *const pxHigherPriorityTaskWoken) PRIVILEGED_FUNCTION
UBaseType_t uxQueueMessagesWaiting(const QueueHandle_t xQueue) PRIVILEGED_FUNCTION
BaseType_t xQueueReceive(QueueHandle_t xQueue, void *const pvBuffer, TickType_t xTicksToWait) PRIVILEGED_FUNCTION
#define uxSemaphoreGetCountFromISR(xSemaphore)
semphr.h
#define xSemaphoreTakeFromISR(xSemaphore, pxHigherPriorityTaskWoken)
semphr.
#define xSemaphoreGiveFromISR(xSemaphore, pxHigherPriorityTaskWoken)
#define uxSemaphoreGetCount(xSemaphore)
semphr.h
#define xSemaphoreGive(xSemaphore)
#define vSemaphoreDelete(xSemaphore)
QueueHandle_t SemaphoreHandle_t
#define xSemaphoreTake(xSemaphore, xBlockTime)
Attributes structure for event flags.
uint32_t cb_size
size of provided memory for control block
void * cb_mem
memory for control block
Attributes structure for memory pool.
uint32_t mp_size
size of provided memory for data storage
const char * name
name of the memory pool
void * cb_mem
memory for control block
uint32_t cb_size
size of provided memory for control block
void * mp_mem
memory for data storage
Attributes structure for message queue.
const char * name
name of the message queue
void * cb_mem
memory for control block
uint32_t mq_size
size of provided memory for data storage
uint32_t cb_size
size of provided memory for control block
void * mq_mem
memory for data storage
Attributes structure for mutex.
uint32_t cb_size
size of provided memory for control block
uint32_t attr_bits
attribute bits
const char * name
name of the mutex
void * cb_mem
memory for control block
Attributes structure for semaphore.
const char * name
name of the semaphore
uint32_t cb_size
size of provided memory for control block
void * cb_mem
memory for control block
Attributes structure for thread.
void * cb_mem
memory for control block
uint32_t attr_bits
attribute bits
uint32_t cb_size
size of provided memory for control block
void * stack_mem
memory for stack
osPriority_t priority
initial thread priority (default: osPriorityNormal)
uint32_t stack_size
size of stack
const char * name
name of the thread
Attributes structure for timer.
void * cb_mem
memory for control block
const char * name
name of the timer
uint32_t cb_size
size of provided memory for control block
uint32_t api
API version (major.minor.rev: mmnnnrrrr dec).
uint32_t kernel
Kernel version (major.minor.rev: mmnnnrrrr dec).
BaseType_t xTaskResumeAll(void) PRIVILEGED_FUNCTION
BaseType_t xTaskGetSchedulerState(void) PRIVILEGED_FUNCTION
#define taskSCHEDULER_NOT_STARTED
TickType_t xTaskGetTickCountFromISR(void) PRIVILEGED_FUNCTION
#define taskSCHEDULER_SUSPENDED
#define xTaskNotify(xTaskToNotify, ulValue, eAction)
UBaseType_t uxTaskPriorityGet(const TaskHandle_t xTask) PRIVILEGED_FUNCTION
#define xTaskNotifyFromISR(xTaskToNotify, ulValue, eAction, pxHigherPriorityTaskWoken)
void vTaskPrioritySet(TaskHandle_t xTask, UBaseType_t uxNewPriority) PRIVILEGED_FUNCTION
#define xTaskNotifyWait(ulBitsToClearOnEntry, ulBitsToClearOnExit, pulNotificationValue, xTicksToWait)
struct tskTaskControlBlock * TaskHandle_t
void vTaskDelete(TaskHandle_t xTaskToDelete) PRIVILEGED_FUNCTION
void vTaskSuspendAll(void) PRIVILEGED_FUNCTION
#define xTaskNotifyAndQueryFromISR(xTaskToNotify, ulValue, eAction, pulPreviousNotificationValue, pxHigherPriorityTaskWoken)
UBaseType_t uxTaskGetNumberOfTasks(void) PRIVILEGED_FUNCTION
TickType_t xTaskGetTickCount(void) PRIVILEGED_FUNCTION
UBaseType_t uxTaskGetStackHighWaterMark(TaskHandle_t xTask) PRIVILEGED_FUNCTION
task.h
void vTaskResume(TaskHandle_t xTaskToResume) PRIVILEGED_FUNCTION
void vTaskSuspend(TaskHandle_t xTaskToSuspend) PRIVILEGED_FUNCTION
TaskHandle_t xTaskGetCurrentTaskHandle(void) PRIVILEGED_FUNCTION
UBaseType_t uxTaskGetSystemState(TaskStatus_t *const pxTaskStatusArray, const UBaseType_t uxArraySize, configRUN_TIME_COUNTER_TYPE *const pulTotalRunTime) PRIVILEGED_FUNCTION
configUSE_TRACE_FACILITY must be defined as 1 in FreeRTOSConfig.h for uxTaskGetSystemState() to be av...
eTaskState eTaskGetState(TaskHandle_t xTask) PRIVILEGED_FUNCTION
task.
void vTaskDelay(const TickType_t xTicksToDelay) PRIVILEGED_FUNCTION
#define xTaskNotifyAndQuery(xTaskToNotify, ulValue, eAction, pulPreviousNotifyValue)
#define taskEXIT_CRITICAL()
void vTaskStartScheduler(void) PRIVILEGED_FUNCTION
#define taskENTER_CRITICAL()
#define taskENTER_CRITICAL_FROM_ISR()
#define taskSCHEDULER_RUNNING
struct xTASK_STATUS TaskStatus_t
char * pcTaskGetName(TaskHandle_t xTaskToQuery) PRIVILEGED_FUNCTION
BaseType_t xTaskDelayUntil(TickType_t *const pxPreviousWakeTime, const TickType_t xTimeIncrement) PRIVILEGED_FUNCTION
#define taskEXIT_CRITICAL_FROM_ISR(x)
void * pvTimerGetTimerID(const TimerHandle_t xTimer) PRIVILEGED_FUNCTION
TimerHandle_t xTimerCreate( const char * const pcTimerName, TickType_t...
BaseType_t xTimerIsTimerActive(TimerHandle_t xTimer) PRIVILEGED_FUNCTION
BaseType_t xTimerIsTimerActive( TimerHandle_t xTimer );.
const char * pcTimerGetName(TimerHandle_t xTimer) PRIVILEGED_FUNCTION
const char * const pcTimerGetName( TimerHandle_t xTimer );
#define xTimerStop(xTimer, xTicksToWait)
BaseType_t xTimerStop( TimerHandle_t xTimer, TickType_t xTicksToWait );.
#define xTimerDelete(xTimer, xTicksToWait)
BaseType_t xTimerDelete( TimerHandle_t xTimer, TickType_t xTicksToWait );.
#define xTimerChangePeriod(xTimer, xNewPeriod, xTicksToWait)
BaseType_t xTimerChangePeriod( TimerHandle_t xTimer, TickType_t x...
struct tmrTimerControl * TimerHandle_t