Prusa MINI Firmware overview
|
CMSIS-RTOS API implementation for FreeRTOS V9.0.0.
More...
#include <string.h>
#include "cmsis_os.h"
|
void | xPortSysTickHandler (void) |
|
static unsigned portBASE_TYPE | makeFreeRtosPriority (osPriority priority) |
|
static int | inHandlerMode (void) |
|
osStatus | osKernelInitialize (void) |
| Initialize the RTOS Kernel for creating objects. More...
|
|
osStatus | osKernelStart (void) |
| Start the RTOS Kernel with executing the specified thread. More...
|
|
int32_t | osKernelRunning (void) |
| Check if the RTOS kernel is already started. More...
|
|
uint32_t | osKernelSysTick (void) |
| Get the value of the Kernel SysTick timer. More...
|
|
osThreadId | osThreadCreate (const osThreadDef_t *thread_def, void *argument) |
| Create a thread and add it to Active Threads and set it to state READY. More...
|
|
osThreadId | osThreadGetId (void) |
| Return the thread ID of the current running thread. More...
|
|
osStatus | osThreadTerminate (osThreadId thread_id) |
| Terminate execution of a thread and remove it from Active Threads. More...
|
|
osStatus | osThreadYield (void) |
| Pass control to next thread that is in state READY. More...
|
|
osStatus | osThreadSetPriority (osThreadId thread_id, osPriority priority) |
| Change priority of an active thread. More...
|
|
osPriority | osThreadGetPriority (osThreadId thread_id) |
| Get current priority of an active thread. More...
|
|
osStatus | osDelay (uint32_t millisec) |
| Wait for Timeout (Time Delay) More...
|
|
osTimerId | osTimerCreate (const osTimerDef_t *timer_def, os_timer_type type, void *argument) |
| Create a timer. More...
|
|
osStatus | osTimerStart (osTimerId timer_id, uint32_t millisec) |
| Start or restart a timer. More...
|
|
osStatus | osTimerStop (osTimerId timer_id) |
| Stop a timer. More...
|
|
osStatus | osTimerDelete (osTimerId timer_id) |
| Delete a timer. More...
|
|
int32_t | osSignalSet (osThreadId thread_id, int32_t signal) |
| Set the specified Signal Flags of an active thread. More...
|
|
int32_t | osSignalClear (osThreadId thread_id, int32_t signal) |
| Clear the specified Signal Flags of an active thread. More...
|
|
osEvent | osSignalWait (int32_t signals, uint32_t millisec) |
| Wait for one or more Signal Flags to become signaled for the current RUNNING thread. More...
|
|
osMutexId | osMutexCreate (const osMutexDef_t *mutex_def) |
| Create and Initialize a Mutex object. More...
|
|
osStatus | osMutexWait (osMutexId mutex_id, uint32_t millisec) |
| Wait until a Mutex becomes available. More...
|
|
osStatus | osMutexRelease (osMutexId mutex_id) |
| Release a Mutex that was obtained by osMutexWait. More...
|
|
osStatus | osMutexDelete (osMutexId mutex_id) |
| Delete a Mutex. More...
|
|
osSemaphoreId | osSemaphoreCreate (const osSemaphoreDef_t *semaphore_def, int32_t count) |
| Create and Initialize a Semaphore object used for managing resources. More...
|
|
int32_t | osSemaphoreWait (osSemaphoreId semaphore_id, uint32_t millisec) |
| Wait until a Semaphore token becomes available. More...
|
|
osStatus | osSemaphoreRelease (osSemaphoreId semaphore_id) |
| Release a Semaphore token. More...
|
|
osStatus | osSemaphoreDelete (osSemaphoreId semaphore_id) |
| Delete a Semaphore. More...
|
|
osPoolId | osPoolCreate (const osPoolDef_t *pool_def) |
| Create and Initialize a memory pool. More...
|
|
void * | osPoolAlloc (osPoolId pool_id) |
| Allocate a memory block from a memory pool. More...
|
|
void * | osPoolCAlloc (osPoolId pool_id) |
| Allocate a memory block from a memory pool and set memory block to zero. More...
|
|
osStatus | osPoolFree (osPoolId pool_id, void *block) |
| Return an allocated memory block back to a specific memory pool. More...
|
|
osMessageQId | osMessageCreate (const osMessageQDef_t *queue_def, osThreadId thread_id) |
| Create and Initialize a Message Queue. More...
|
|
osStatus | osMessagePut (osMessageQId queue_id, uint32_t info, uint32_t millisec) |
| Put a Message to a Queue. More...
|
|
osEvent | osMessageGet (osMessageQId queue_id, uint32_t millisec) |
| Get a Message or Wait for a Message from a Queue. More...
|
|
osMailQId | osMailCreate (const osMailQDef_t *queue_def, osThreadId thread_id) |
| Create and Initialize mail queue. More...
|
|
void * | osMailAlloc (osMailQId queue_id, uint32_t millisec) |
| Allocate a memory block from a mail. More...
|
|
void * | osMailCAlloc (osMailQId queue_id, uint32_t millisec) |
| Allocate a memory block from a mail and set memory block to zero. More...
|
|
osStatus | osMailPut (osMailQId queue_id, void *mail) |
| Put a mail to a queue. More...
|
|
osEvent | osMailGet (osMailQId queue_id, uint32_t millisec) |
| Get a mail from a queue. More...
|
|
osStatus | osMailFree (osMailQId queue_id, void *mail) |
| Free a memory block from a mail. More...
|
|
void | osSystickHandler (void) |
| Handles the tick increment. More...
|
|
osStatus | osThreadSuspend (osThreadId thread_id) |
| Suspend execution of a thread. More...
|
|
osStatus | osThreadResume (osThreadId thread_id) |
| Resume execution of a suspended thread. More...
|
|
osStatus | osThreadSuspendAll (void) |
| Suspend execution of a all active threads. More...
|
|
osStatus | osThreadResumeAll (void) |
| Resume execution of a all suspended threads. More...
|
|
osStatus | osDelayUntil (uint32_t *PreviousWakeTime, uint32_t millisec) |
| Delay a task until a specified time. More...
|
|
osStatus | osAbortDelay (osThreadId thread_id) |
| Abort the delay for a specific thread. More...
|
|
osStatus | osThreadList (uint8_t *buffer) |
| Lists all the current threads, along with their current state and stack usage high water mark. More...
|
|
osEvent | osMessagePeek (osMessageQId queue_id, uint32_t millisec) |
| Receive an item from a queue without removing the item from the queue. More...
|
|
uint32_t | osMessageWaiting (osMessageQId queue_id) |
| Get the number of messaged stored in a queue. More...
|
|
uint32_t | osMessageAvailableSpace (osMessageQId queue_id) |
| Get the available space in a message queue. More...
|
|
osStatus | osMessageDelete (osMessageQId queue_id) |
| Delete a Message Queue. More...
|
|
osMutexId | osRecursiveMutexCreate (const osMutexDef_t *mutex_def) |
| Create and Initialize a Recursive Mutex. More...
|
|
osStatus | osRecursiveMutexRelease (osMutexId mutex_id) |
| Release a Recursive Mutex. More...
|
|
osStatus | osRecursiveMutexWait (osMutexId mutex_id, uint32_t millisec) |
| Release a Recursive Mutex. More...
|
|
uint32_t | osSemaphoreGetCount (osSemaphoreId semaphore_id) |
| Returns the current count value of a counting semaphore. More...
|
|
CMSIS-RTOS API implementation for FreeRTOS V9.0.0.
- Author
- MCD Application Team
- Date
- 13-July-2017
- Attention
Redistribution and use in source and binary forms, with or without modification, are permitted, provided that the following conditions are met:
- Redistribution of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
- Neither the name of STMicroelectronics nor the names of other contributors to this software may be used to endorse or promote products derived from this software without specific written permission.
- This software, including modifications and/or derivative works of this software, must execute solely and exclusively on microcontroller or microprocessor devices manufactured by or for STMicroelectronics.
- Redistribution and use of this software other than as permitted under this license is void and will automatically terminate your rights under this license.
THIS SOFTWARE IS PROVIDED BY STMICROELECTRONICS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS, IMPLIED OR STATUTORY WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT OF THIRD PARTY INTELLECTUAL PROPERTY RIGHTS ARE DISCLAIMED TO THE FULLEST EXTENT PERMITTED BY LAW. IN NO EVENT SHALL STMICROELECTRONICS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
◆ os_pool_cb_t
◆ os_mailQ_cb_t
◆ xPortSysTickHandler()
◆ makeFreeRtosPriority()
◆ inHandlerMode()
static int inHandlerMode |
( |
void |
| ) |
|
|
static |
175 return __get_IPSR() != 0;
◆ osKernelInitialize()
Initialize the RTOS Kernel for creating objects.
- Return values
-
status | code that indicates the execution status of the function. |
- Note
- MUST REMAIN UNCHANGED: osKernelInitialize shall be consistent in every CMSIS-RTOS.
◆ osKernelStart()
Start the RTOS Kernel with executing the specified thread.
- Parameters
-
thread_def | thread definition referenced with osThread. |
argument | pointer that is passed to the thread function as start argument. |
- Return values
-
status | code that indicates the execution status of the function |
- Note
- MUST REMAIN UNCHANGED: osKernelStart shall be consistent in every CMSIS-RTOS.
◆ osKernelRunning()
int32_t osKernelRunning |
( |
void |
| ) |
|
Check if the RTOS kernel is already started.
- Parameters
-
- Return values
-
(0) | RTOS is not started (1) RTOS is started (-1) if this feature is disabled in FreeRTOSConfig.h |
- Note
- MUST REMAIN UNCHANGED: osKernelRunning shall be consistent in every CMSIS-RTOS.
210 #if ( ( INCLUDE_xTaskGetSchedulerState == 1 ) || ( configUSE_TIMERS == 1 ) )
◆ osKernelSysTick()
uint32_t osKernelSysTick |
( |
void |
| ) |
|
Get the value of the Kernel SysTick timer.
- Parameters
-
- Return values
-
- Note
- MUST REMAIN UNCHANGED: osKernelSysTick shall be consistent in every CMSIS-RTOS.
◆ osThreadCreate()
Create a thread and add it to Active Threads and set it to state READY.
- Parameters
-
thread_def | thread definition referenced with osThread. |
argument | pointer that is passed to the thread function as start argument. |
- Return values
-
thread | ID for reference by other functions or NULL in case of error. |
- Note
- MUST REMAIN UNCHANGED: osThreadCreate shall be consistent in every CMSIS-RTOS.
249 #if( configSUPPORT_STATIC_ALLOCATION == 1 ) && ( configSUPPORT_DYNAMIC_ALLOCATION == 1 )
250 if((thread_def->buffer !=
NULL) && (thread_def->controlblock !=
NULL)) {
253 thread_def->buffer, thread_def->controlblock);
262 #elif( configSUPPORT_STATIC_ALLOCATION == 1 )
266 thread_def->buffer, thread_def->controlblock);
◆ osThreadGetId()
Return the thread ID of the current running thread.
- Return values
-
thread | ID for reference by other functions or NULL in case of error. |
- Note
- MUST REMAIN UNCHANGED: osThreadGetId shall be consistent in every CMSIS-RTOS.
285 #if ( ( INCLUDE_xTaskGetCurrentTaskHandle == 1 ) || ( configUSE_MUTEXES == 1 ) )
◆ osThreadTerminate()
Terminate execution of a thread and remove it from Active Threads.
- Parameters
-
- Return values
-
status | code that indicates the execution status of the function. |
- Note
- MUST REMAIN UNCHANGED: osThreadTerminate shall be consistent in every CMSIS-RTOS.
300 #if (INCLUDE_vTaskDelete == 1)
◆ osThreadYield()
Pass control to next thread that is in state READY.
- Return values
-
status | code that indicates the execution status of the function. |
- Note
- MUST REMAIN UNCHANGED: osThreadYield shall be consistent in every CMSIS-RTOS.
◆ osThreadSetPriority()
Change priority of an active thread.
- Parameters
-
- Return values
-
status | code that indicates the execution status of the function. |
- Note
- MUST REMAIN UNCHANGED: osThreadSetPriority shall be consistent in every CMSIS-RTOS.
329 #if (INCLUDE_vTaskPrioritySet == 1)
◆ osThreadGetPriority()
Get current priority of an active thread.
- Parameters
-
- Return values
-
current | priority value of the thread function. |
- Note
- MUST REMAIN UNCHANGED: osThreadGetPriority shall be consistent in every CMSIS-RTOS.
345 #if (INCLUDE_uxTaskPriorityGet == 1)
◆ osDelay()
Wait for Timeout (Time Delay)
- Parameters
-
- Return values
-
status | code that indicates the execution status of the function. |
367 #if INCLUDE_vTaskDelay
◆ osTimerCreate()
Create a timer.
- Parameters
-
timer_def | timer object referenced with osTimer. |
type | osTimerOnce for one-shot or osTimerPeriodic for periodic behavior. |
argument | argument to the timer call back function. |
- Return values
-
timer | ID for reference by other functions or NULL in case of error. |
- Note
- MUST REMAIN UNCHANGED: osTimerCreate shall be consistent in every CMSIS-RTOS.
402 #if (configUSE_TIMERS == 1)
404 #if( ( configSUPPORT_STATIC_ALLOCATION == 1 ) && ( configSUPPORT_DYNAMIC_ALLOCATION == 1 ) )
405 if(timer_def->controlblock !=
NULL) {
406 return xTimerCreateStatic((
const char *)
"",
414 return xTimerCreate((
const char *)
"",
420 #elif( configSUPPORT_STATIC_ALLOCATION == 1 )
421 return xTimerCreateStatic((
const char *)
"",
428 return xTimerCreate((
const char *)
"",
◆ osTimerStart()
Start or restart a timer.
- Parameters
-
timer_id | timer ID obtained by osTimerCreate. |
millisec | time delay value of the timer. |
- Return values
-
status | code that indicates the execution status of the function |
- Note
- MUST REMAIN UNCHANGED: osTimerStart shall be consistent in every CMSIS-RTOS.
450 #if (configUSE_TIMERS == 1)
◆ osTimerStop()
Stop a timer.
- Parameters
-
- Return values
-
status | code that indicates the execution status of the function. |
- Note
- MUST REMAIN UNCHANGED: osTimerStop shall be consistent in every CMSIS-RTOS.
489 #if (configUSE_TIMERS == 1)
◆ osTimerDelete()
Delete a timer.
- Parameters
-
- Return values
-
status | code that indicates the execution status of the function. |
- Note
- MUST REMAIN UNCHANGED: osTimerDelete shall be consistent in every CMSIS-RTOS.
519 #if (configUSE_TIMERS == 1)
◆ osSignalSet()
int32_t osSignalSet |
( |
osThreadId |
thread_id, |
|
|
int32_t |
signal |
|
) |
| |
Set the specified Signal Flags of an active thread.
- Parameters
-
- Return values
-
previous | signal flags of the specified thread or 0x80000000 in case of incorrect parameters. |
- Note
- MUST REMAIN UNCHANGED: osSignalSet shall be consistent in every CMSIS-RTOS.
547 #if( configUSE_TASK_NOTIFICATIONS == 1 )
549 uint32_t ulPreviousNotificationValue = 0;
561 return ulPreviousNotificationValue;
◆ osSignalClear()
int32_t osSignalClear |
( |
osThreadId |
thread_id, |
|
|
int32_t |
signal |
|
) |
| |
Clear the specified Signal Flags of an active thread.
- Parameters
-
- Return values
-
previous | signal flags of the specified thread or 0x80000000 in case of incorrect parameters. |
- Note
- MUST REMAIN UNCHANGED: osSignalClear shall be consistent in every CMSIS-RTOS.
◆ osSignalWait()
osEvent osSignalWait |
( |
int32_t |
signals, |
|
|
uint32_t |
millisec |
|
) |
| |
Wait for one or more Signal Flags to become signaled for the current RUNNING thread.
- Parameters
-
signals | wait until all specified signal flags set or 0 for any single signal flag. |
millisec | timeout value or 0 in case of no time-out. |
- Return values
-
event | flag information or error code. |
- Note
- MUST REMAIN UNCHANGED: osSignalWait shall be consistent in every CMSIS-RTOS.
590 #if( configUSE_TASK_NOTIFICATIONS == 1 )
599 else if (millisec != 0) {
◆ osMutexCreate()
Create and Initialize a Mutex object.
- Parameters
-
mutex_def | mutex definition referenced with osMutex. |
- Return values
-
mutex | ID for reference by other functions or NULL in case of error. |
- Note
- MUST REMAIN UNCHANGED: osMutexCreate shall be consistent in every CMSIS-RTOS.
642 #if ( configUSE_MUTEXES == 1)
644 #if( configSUPPORT_STATIC_ALLOCATION == 1 ) && ( configSUPPORT_DYNAMIC_ALLOCATION == 1 )
646 if (mutex_def->controlblock !=
NULL) {
647 return xSemaphoreCreateMutexStatic( mutex_def->controlblock );
650 return xSemaphoreCreateMutex();
652 #elif ( configSUPPORT_STATIC_ALLOCATION == 1 )
653 return xSemaphoreCreateMutexStatic( mutex_def->controlblock );
655 return xSemaphoreCreateMutex();
◆ osMutexWait()
Wait until a Mutex becomes available.
- Parameters
-
mutex_id | mutex ID obtained by osMutexCreate. |
millisec | timeout value or 0 in case of no time-out. |
- Return values
-
status | code that indicates the execution status of the function. |
- Note
- MUST REMAIN UNCHANGED: osMutexWait shall be consistent in every CMSIS-RTOS.
675 if (mutex_id ==
NULL) {
683 else if (millisec != 0) {
◆ osMutexRelease()
Release a Mutex that was obtained by osMutexWait.
- Parameters
-
- Return values
-
status | code that indicates the execution status of the function. |
- Note
- MUST REMAIN UNCHANGED: osMutexRelease shall be consistent in every CMSIS-RTOS.
◆ osMutexDelete()
Delete a Mutex.
- Parameters
-
- Return values
-
status | code that indicates the execution status of the function. |
- Note
- MUST REMAIN UNCHANGED: osMutexDelete shall be consistent in every CMSIS-RTOS.
◆ osSemaphoreCreate()
Create and Initialize a Semaphore object used for managing resources.
- Parameters
-
semaphore_def | semaphore definition referenced with osSemaphore. |
count | number of available resources. |
- Return values
-
semaphore | ID for reference by other functions or NULL in case of error. |
- Note
- MUST REMAIN UNCHANGED: osSemaphoreCreate shall be consistent in every CMSIS-RTOS.
757 #if( configSUPPORT_STATIC_ALLOCATION == 1 ) && ( configSUPPORT_DYNAMIC_ALLOCATION == 1 )
761 if (semaphore_def->controlblock !=
NULL){
763 return xSemaphoreCreateBinaryStatic( semaphore_def->controlblock );
766 #if (configUSE_COUNTING_SEMAPHORES == 1 )
767 return xSemaphoreCreateCountingStatic( count, count, semaphore_def->controlblock );
775 vSemaphoreCreateBinary(sema);
779 #if (configUSE_COUNTING_SEMAPHORES == 1 )
780 return xSemaphoreCreateCounting(count, count);
786 #elif ( configSUPPORT_STATIC_ALLOCATION == 1 ) // configSUPPORT_DYNAMIC_ALLOCATION == 0
788 return xSemaphoreCreateBinaryStatic( semaphore_def->controlblock );
792 #if (configUSE_COUNTING_SEMAPHORES == 1 )
793 return xSemaphoreCreateCountingStatic( count, count, semaphore_def->controlblock );
798 #else // configSUPPORT_STATIC_ALLOCATION == 0 && configSUPPORT_DYNAMIC_ALLOCATION == 1
802 vSemaphoreCreateBinary(sema);
806 #if (configUSE_COUNTING_SEMAPHORES == 1 )
807 return xSemaphoreCreateCounting(count, count);
◆ osSemaphoreWait()
int32_t osSemaphoreWait |
( |
osSemaphoreId |
semaphore_id, |
|
|
uint32_t |
millisec |
|
) |
| |
Wait until a Semaphore token becomes available.
- Parameters
-
semaphore_id | semaphore object referenced with osSemaphore. |
millisec | timeout value or 0 in case of no time-out. |
- Return values
-
number | of available tokens, or -1 in case of incorrect parameters. |
- Note
- MUST REMAIN UNCHANGED: osSemaphoreWait shall be consistent in every CMSIS-RTOS.
828 if (semaphore_id ==
NULL) {
836 else if (millisec != 0) {
◆ osSemaphoreRelease()
Release a Semaphore token.
- Parameters
-
semaphore_id | semaphore object referenced with osSemaphore. |
- Return values
-
status | code that indicates the execution status of the function. |
- Note
- MUST REMAIN UNCHANGED: osSemaphoreRelease shall be consistent in every CMSIS-RTOS.
◆ osSemaphoreDelete()
Delete a Semaphore.
- Parameters
-
semaphore_id | semaphore object referenced with osSemaphore. |
- Return values
-
status | code that indicates the execution status of the function. |
- Note
- MUST REMAIN UNCHANGED: osSemaphoreDelete shall be consistent in every CMSIS-RTOS.
◆ osPoolCreate()
Create and Initialize a memory pool.
- Parameters
-
pool_def | memory pool definition referenced with osPool. |
- Return values
-
memory | pool ID for reference by other functions or NULL in case of error. |
- Note
- MUST REMAIN UNCHANGED: osPoolCreate shall be consistent in every CMSIS-RTOS.
928 #if (configSUPPORT_DYNAMIC_ALLOCATION == 1)
930 int itemSize = 4 * ((pool_def->
item_sz + 3) / 4);
◆ osPoolAlloc()
Allocate a memory block from a memory pool.
- Parameters
-
- Return values
-
address | of the allocated memory block or NULL in case of no memory available. |
- Note
- MUST REMAIN UNCHANGED: osPoolAlloc shall be consistent in every CMSIS-RTOS.
995 if (index >= pool_id->
pool_sz) {
999 if (pool_id->
markers[index] == 0) {
1001 p = (
void *)((uint32_t)(pool_id->
pool) + (index * pool_id->
item_sz));
◆ osPoolCAlloc()
Allocate a memory block from a memory pool and set memory block to zero.
- Parameters
-
- Return values
-
address | of the allocated memory block or NULL in case of no memory available. |
- Note
- MUST REMAIN UNCHANGED: osPoolCAlloc shall be consistent in every CMSIS-RTOS.
1029 memset(p, 0,
sizeof(pool_id->
pool_sz));
◆ osPoolFree()
Return an allocated memory block back to a specific memory pool.
- Parameters
-
pool_id | memory pool ID obtain referenced with osPoolCreate. |
block | address of the allocated memory block that is returned to the memory pool. |
- Return values
-
status | code that indicates the execution status of the function. |
- Note
- MUST REMAIN UNCHANGED: osPoolFree shall be consistent in every CMSIS-RTOS.
1046 if (pool_id ==
NULL) {
1050 if (block ==
NULL) {
1054 if (block < pool_id->pool) {
1058 index = (uint32_t)block - (uint32_t)(pool_id->
pool);
1059 if (index % pool_id->
item_sz) {
1062 index = index / pool_id->
item_sz;
1063 if (index >= pool_id->
pool_sz) {
◆ osMessageCreate()
Create and Initialize a Message Queue.
- Parameters
-
- Return values
-
message | queue ID for reference by other functions or NULL in case of error. |
- Note
- MUST REMAIN UNCHANGED: osMessageCreate shall be consistent in every CMSIS-RTOS.
1090 #if( configSUPPORT_STATIC_ALLOCATION == 1 ) && ( configSUPPORT_DYNAMIC_ALLOCATION == 1 )
1092 if ((queue_def->buffer !=
NULL) && (queue_def->controlblock !=
NULL)) {
1093 return xQueueCreateStatic(queue_def->
queue_sz, queue_def->
item_sz, queue_def->buffer, queue_def->controlblock);
1098 #elif ( configSUPPORT_STATIC_ALLOCATION == 1 )
1099 return xQueueCreateStatic(queue_def->
queue_sz, queue_def->
item_sz, queue_def->buffer, queue_def->controlblock);
◆ osMessagePut()
Put a Message to a Queue.
- Parameters
-
queue_id | message queue ID obtained with osMessageCreate. |
info | message information. |
millisec | timeout value or 0 in case of no time-out. |
- Return values
-
status | code that indicates the execution status of the function. |
- Note
- MUST REMAIN UNCHANGED: osMessagePut shall be consistent in every CMSIS-RTOS.
◆ osMessageGet()
Get a Message or Wait for a Message from a Queue.
- Parameters
-
queue_id | message queue ID obtained with osMessageCreate. |
millisec | timeout value or 0 in case of no time-out. |
- Return values
-
event | information that includes status code. |
- Note
- MUST REMAIN UNCHANGED: osMessageGet shall be consistent in every CMSIS-RTOS.
1154 if (queue_id ==
NULL) {
1165 else if (millisec != 0) {
1178 event.status =
osOK;
◆ osMailCreate()
Create and Initialize mail queue.
- Parameters
-
- Return values
-
mail | queue ID for reference by other functions or NULL in case of error. |
- Note
- MUST REMAIN UNCHANGED: osMailCreate shall be consistent in every CMSIS-RTOS.
1216 #if (configSUPPORT_DYNAMIC_ALLOCATION == 1)
1225 if (*(queue_def->
cb) ==
NULL) {
1228 (*(queue_def->
cb))->queue_def = queue_def;
1231 (*(queue_def->
cb))->handle = xQueueCreate(queue_def->
queue_sz,
sizeof(
void *));
1234 if ((*(queue_def->
cb))->handle ==
NULL) {
1241 if ((*(queue_def->
cb))->pool ==
NULL) {
1247 return *(queue_def->
cb);
◆ osMailAlloc()
Allocate a memory block from a mail.
- Parameters
-
queue_id | mail queue ID obtained with osMailCreate. |
millisec | timeout value or 0 in case of no time-out. |
- Return values
-
pointer | to memory block that can be filled with mail or NULL in case error. |
- Note
- MUST REMAIN UNCHANGED: osMailAlloc shall be consistent in every CMSIS-RTOS.
1266 if (queue_id ==
NULL) {
◆ osMailCAlloc()
Allocate a memory block from a mail and set memory block to zero.
- Parameters
-
queue_id | mail queue ID obtained with osMailCreate. |
millisec | timeout value or 0 in case of no time-out. |
- Return values
-
pointer | to memory block that can be filled with mail or NULL in case error. |
- Note
- MUST REMAIN UNCHANGED: osMailCAlloc shall be consistent in every CMSIS-RTOS.
◆ osMailPut()
Put a mail to a queue.
- Parameters
-
- Return values
-
status | code that indicates the execution status of the function. |
- Note
- MUST REMAIN UNCHANGED: osMailPut shall be consistent in every CMSIS-RTOS.
1308 if (queue_id ==
NULL) {
◆ osMailGet()
Get a mail from a queue.
- Parameters
-
queue_id | mail queue ID obtained with osMailCreate. |
millisec | timeout value or 0 in case of no time-out |
- Return values
-
event | that contains mail information or error code. |
- Note
- MUST REMAIN UNCHANGED: osMailGet shall be consistent in every CMSIS-RTOS.
1344 if (queue_id ==
NULL) {
1355 else if (millisec != 0) {
1368 event.status =
osOK;
◆ osMailFree()
Free a memory block from a mail.
- Parameters
-
queue_id | mail queue ID obtained with osMailCreate. |
mail | pointer to the memory block that was obtained with osMailGet. |
- Return values
-
status | code that indicates the execution status of the function. |
- Note
- MUST REMAIN UNCHANGED: osMailFree shall be consistent in every CMSIS-RTOS.
1394 if (queue_id ==
NULL) {
◆ osSystickHandler()
Handles the tick increment.
- Parameters
-
- Return values
-
1411 #if (INCLUDE_xTaskGetSchedulerState == 1 )
1416 #if (INCLUDE_xTaskGetSchedulerState == 1 )
◆ osThreadSuspend()
Suspend execution of a thread.
- Parameters
-
- Return values
-
status | code that indicates the execution status of the function. |
1480 #if (INCLUDE_vTaskSuspend == 1)
◆ osThreadResume()
Resume execution of a suspended thread.
- Parameters
-
- Return values
-
status | code that indicates the execution status of the function. |
1496 #if (INCLUDE_vTaskSuspend == 1)
◆ osThreadSuspendAll()
Suspend execution of a all active threads.
- Return values
-
status | code that indicates the execution status of the function. |
◆ osThreadResumeAll()
Resume execution of a all suspended threads.
- Return values
-
status | code that indicates the execution status of the function. |
◆ osDelayUntil()
osStatus osDelayUntil |
( |
uint32_t * |
PreviousWakeTime, |
|
|
uint32_t |
millisec |
|
) |
| |
Delay a task until a specified time.
- Parameters
-
PreviousWakeTime | Pointer to a variable that holds the time at which the task was last unblocked. PreviousWakeTime must be initialised with the current time prior to its first use (PreviousWakeTime = osKernelSysTick() ) |
millisec | time delay value |
- Return values
-
status | code that indicates the execution status of the function. |
1548 #if INCLUDE_vTaskDelayUntil
1555 (
void) PreviousWakeTime;
◆ osAbortDelay()
Abort the delay for a specific thread.
- Parameters
-
- Return values
-
status | code that indicates the execution status of the function. |
1568 #if INCLUDE_xTaskAbortDelay
◆ osThreadList()
Lists all the current threads, along with their current state and stack usage high water mark.
- Parameters
-
buffer | A buffer into which the above mentioned details will be written |
- Return values
-
status | code that indicates the execution status of the function. |
1589 #if ( ( configUSE_TRACE_FACILITY == 1 ) && ( configUSE_STATS_FORMATTING_FUNCTIONS == 1 ) )
◆ osMessagePeek()
Receive an item from a queue without removing the item from the queue.
- Parameters
-
queue_id | message queue ID obtained with osMessageCreate. |
millisec | timeout value or 0 in case of no time-out. |
- Return values
-
event | information that includes status code. |
1608 if (queue_id ==
NULL) {
1617 else if (millisec != 0) {
◆ osMessageWaiting()
Get the number of messaged stored in a queue.
- Parameters
-
- Return values
-
number | of messages stored in a queue. |
◆ osMessageAvailableSpace()
Get the available space in a message queue.
- Parameters
-
- Return values
-
available | space in a message queue. |
◆ osMessageDelete()
Delete a Message Queue.
- Parameters
-
- Return values
-
status | code that indicates the execution status of the function. |
◆ osRecursiveMutexCreate()
Create and Initialize a Recursive Mutex.
- Parameters
-
mutex_def | mutex definition referenced with osMutex. |
- Return values
-
mutex | ID for reference by other functions or NULL in case of error.. |
1686 #if (configUSE_RECURSIVE_MUTEXES == 1)
1687 #if( configSUPPORT_STATIC_ALLOCATION == 1 ) && ( configSUPPORT_DYNAMIC_ALLOCATION == 1 )
1689 if (mutex_def->controlblock !=
NULL){
1690 return xSemaphoreCreateRecursiveMutexStatic( mutex_def->controlblock );
1693 return xSemaphoreCreateRecursiveMutex();
1695 #elif ( configSUPPORT_STATIC_ALLOCATION == 1 )
1696 return xSemaphoreCreateRecursiveMutexStatic( mutex_def->controlblock );
1698 return xSemaphoreCreateRecursiveMutex();
◆ osRecursiveMutexRelease()
Release a Recursive Mutex.
- Parameters
-
- Return values
-
status | code that indicates the execution status of the function. |
1712 #if (configUSE_RECURSIVE_MUTEXES == 1)
1715 if (xSemaphoreGiveRecursive(mutex_id) !=
pdTRUE)
◆ osRecursiveMutexWait()
Release a Recursive Mutex.
- Parameters
-
- Return values
-
status | code that indicates the execution status of the function. |
1733 #if (configUSE_RECURSIVE_MUTEXES == 1)
1736 if (mutex_id ==
NULL)
1746 else if (millisec != 0)
1755 if (xSemaphoreTakeRecursive(mutex_id, ticks) !=
pdTRUE)
◆ osSemaphoreGetCount()
Returns the current count value of a counting semaphore.
- Parameters
-
- Return values
-
void * pool
Definition: cmsis_os.c:912
QueueHandle_t handle
Definition: cmsis_os.c:1203
osPriority tpriority
initial thread priority
Definition: cmsis_os.h:328
osPoolId pool
Definition: cmsis_os.c:1204
const osMailQDef_t * queue_def
Definition: cmsis_os.c:1202
Definition: cmsis_os.c:1201
#define portMAX_DELAY
Definition: portmacro.h:106
#define portSET_INTERRUPT_MASK_FROM_ISR()
Definition: FreeRTOS.h:300
PRIVILEGED_FUNCTION BaseType_t xTaskGenericNotifyFromISR(TaskHandle_t xTaskToNotify, uint32_t ulValue, eNotifyAction eAction, uint32_t *pulPreviousNotificationValue, BaseType_t *pxHigherPriorityTaskWoken)
PRIVILEGED_FUNCTION BaseType_t xTaskGetSchedulerState(void)
PRIVILEGED_FUNCTION BaseType_t xTaskNotifyWait(uint32_t ulBitsToClearOnEntry, uint32_t ulBitsToClearOnExit, uint32_t *pulNotificationValue, TickType_t xTicksToWait)
PRIVILEGED_FUNCTION BaseType_t xTaskGenericNotify(TaskHandle_t xTaskToNotify, uint32_t ulValue, eNotifyAction eAction, uint32_t *pulPreviousNotificationValue)
PRIVILEGED_FUNCTION UBaseType_t uxQueueSpacesAvailable(const QueueHandle_t xQueue)
Definition: queue.c:1595
PRIVILEGED_FUNCTION void vTaskStartScheduler(void)
Definition: tasks.c:1826
PRIVILEGED_FUNCTION void * pvPortMalloc(size_t xSize)
Definition: heap_4.c:155
uint32_t item_sz
size of an item
Definition: cmsis_os.h:388
void * osPoolAlloc(osPoolId pool_id)
Allocate a memory block from a memory pool.
Definition: cmsis_os.c:979
uint8_t type
Definition: UsbCore.h:184
#define xSemaphoreTake(xSemaphore, xBlockTime)
Definition: semphr.h:331
osStatus
Definition: cmsis_os.h:234
uint32_t stacksize
stack size requirements in bytes; 0 is default stack size
Definition: cmsis_os.h:330
uint32_t item_sz
Definition: cmsis_os.c:915
function completed; timeout occurred.
Definition: cmsis_os.h:239
PRIVILEGED_FUNCTION TickType_t xTaskGetTickCountFromISR(void)
Definition: tasks.c:2142
#define xSemaphoreTakeFromISR(xSemaphore, pxHigherPriorityTaskWoken)
Definition: semphr.h:700
uint8_t i
Definition: screen_test_graph.c:72
#define xTimerStopFromISR(xTimer, pxHigherPriorityTaskWoken)
Definition: timers.h:978
not allowed in ISR context: the function cannot be called from interrupt service routines.
Definition: cmsis_os.h:243
PRIVILEGED_FUNCTION TickType_t xTaskGetTickCount(void)
Definition: tasks.c:2127
priority: idle (lowest)
Definition: cmsis_os.h:218
#define xSemaphoreGiveFromISR(xSemaphore, pxHigherPriorityTaskWoken)
Definition: semphr.h:666
#define xTimerStop(xTimer, xTicksToWait)
Definition: timers.h:587
#define NULL
Definition: usbd_def.h:53
osStatus status
status code: event or error information
Definition: cmsis_os.h:396
void vPortEnterCritical(void)
Definition: port.c:407
PRIVILEGED_FUNCTION void vTaskSuspend(TaskHandle_t xTaskToSuspend)
#define pdPASS
Definition: projdefs.h:89
PRIVILEGED_FUNCTION BaseType_t xTaskAbortDelay(TaskHandle_t xTask)
uint32_t currentIndex
Definition: cmsis_os.c:916
uint32_t TickType_t
Definition: portmacro.h:105
resource not available: a specified resource was not available.
Definition: cmsis_os.h:241
SemaphoreHandle_t osSemaphoreId
Definition: cmsis_os.h:295
function completed; mail event occurred.
Definition: cmsis_os.h:238
PRIVILEGED_FUNCTION BaseType_t xTaskResumeFromISR(TaskHandle_t xTaskToResume)
Definition: cmsis_os.h:395
void * TaskHandle_t
Definition: task.h:103
osStatus osPoolFree(osPoolId pool_id, void *block)
Return an allocated memory block back to a specific memory pool.
Definition: cmsis_os.c:1042
system cannot determine priority or thread has illegal priority
Definition: cmsis_os.h:225
#define pdFALSE
Definition: projdefs.h:86
PRIVILEGED_FUNCTION void vTaskDelete(TaskHandle_t xTaskToDelete)
uint32_t pool_sz
number of items (elements) in the pool
Definition: cmsis_os.h:367
#define xTimerChangePeriod(xTimer, xNewPeriod, xTicksToWait)
Definition: timers.h:667
PRIVILEGED_FUNCTION UBaseType_t uxQueueMessagesWaitingFromISR(const QueueHandle_t xQueue)
Definition: queue.c:1613
union osEvent::@55 def
event definition
Definition: FreeRTOS.h:1041
#define uxSemaphoreGetCount(xSemaphore)
Definition: semphr.h:1167
#define xTimerDelete(xTimer, xTicksToWait)
Definition: timers.h:705
Definition: cmsis_os.h:366
PRIVILEGED_FUNCTION TaskHandle_t xTaskGetCurrentTaskHandle(void)
osPoolId osPoolCreate(const osPoolDef_t *pool_def)
Create and Initialize a memory pool.
Definition: cmsis_os.c:926
function completed; no error or event occurred.
Definition: cmsis_os.h:235
#define portYIELD_FROM_ISR(x)
Definition: portmacro.h:135
PRIVILEGED_FUNCTION UBaseType_t uxTaskPriorityGet(TaskHandle_t xTask)
void
Definition: png.h:1083
#define portDISABLE_INTERRUPTS()
Definition: portmacro.h:143
function completed; message event occurred.
Definition: cmsis_os.h:237
PRIVILEGED_FUNCTION void vQueueDelete(QueueHandle_t xQueue)
Definition: queue.c:1625
PRIVILEGED_FUNCTION void vTaskResume(TaskHandle_t xTaskToResume)
PRIVILEGED_FUNCTION BaseType_t xQueueReceiveFromISR(QueueHandle_t xQueue, void *const pvBuffer, BaseType_t *const pxHigherPriorityTaskWoken)
Definition: queue.c:1434
#define portNVIC_PENDSVSET_BIT
Definition: portmacro.h:133
#define portBASE_TYPE
Definition: portmacro.h:95
#define vSemaphoreDelete(xSemaphore)
Definition: semphr.h:1140
#define taskSCHEDULER_NOT_STARTED
Definition: task.h:258
#define osWaitForever
wait forever timeout value
Definition: cmsis_os.h:230
PRIVILEGED_FUNCTION BaseType_t xTaskIncrementTick(void)
Definition: tasks.c:2499
#define taskYIELD()
Definition: task.h:203
char * name
Thread name.
Definition: cmsis_os.h:326
#define xQueueSendFromISR(xQueue, pvItemToQueue, pxHigherPriorityTaskWoken)
Definition: queue.h:1361
os_pthread pthread
start address of thread function
Definition: cmsis_os.h:327
static unsigned portBASE_TYPE makeFreeRtosPriority(osPriority priority)
Definition: cmsis_os.c:146
void(* TaskFunction_t)(void *)
Definition: projdefs.h:77
#define portTICK_PERIOD_MS
Definition: portmacro.h:116
const uint8_t[]
Definition: 404_html.c:3
PRIVILEGED_FUNCTION void vTaskPrioritySet(TaskHandle_t xTask, UBaseType_t uxNewPriority)
uint8_t * markers
Definition: cmsis_os.c:913
#define portENABLE_INTERRUPTS()
Definition: portmacro.h:144
void * osMailAlloc(osMailQId queue_id, uint32_t millisec)
Allocate a memory block from a mail.
Definition: cmsis_os.c:1260
function completed; signal event occurred.
Definition: cmsis_os.h:236
osMailQId mail_id
mail id obtained by osMailCreate
Definition: cmsis_os.h:403
PRIVILEGED_FUNCTION UBaseType_t uxQueueMessagesWaiting(const QueueHandle_t xQueue)
Definition: queue.c:1579
#define portEND_SWITCHING_ISR(xSwitchRequired)
Definition: portmacro.h:134
unspecified RTOS error: run-time error but no other error message fits.
Definition: cmsis_os.h:248
struct os_mailQ_cb ** cb
Definition: cmsis_os.h:389
long BaseType_t
Definition: portmacro.h:98
#define pdTRUE
Definition: projdefs.h:87
parameter error: a mandatory parameter was missing or specified an incorrect object.
Definition: cmsis_os.h:240
value of a parameter is out of range.
Definition: cmsis_os.h:247
PRIVILEGED_FUNCTION void vTaskDelay(const TickType_t xTicksToDelay)
uint32_t item_sz
size of an item
Definition: cmsis_os.h:368
PRIVILEGED_FUNCTION BaseType_t xTaskResumeAll(void)
Definition: tasks.c:2017
#define xTimerChangePeriodFromISR(xTimer, xNewPeriod, pxHigherPriorityTaskWoken)
Definition: timers.h:1051
void xPortSysTickHandler(void)
Definition: port.c:493
PRIVILEGED_FUNCTION void vPortFree(void *pv)
Definition: heap_4.c:305
union osEvent::@54 value
event value
#define portCLEAR_INTERRUPT_MASK_FROM_ISR(uxSavedStatusValue)
Definition: FreeRTOS.h:304
repeating timer
Definition: cmsis_os.h:268
Definition: cmsis_os.c:911
static int inHandlerMode(void)
Definition: cmsis_os.c:173
void vPortExitCritical(void)
Definition: port.c:424
uint32_t queue_sz
number of elements in the queue
Definition: cmsis_os.h:387
#define portCHAR
Definition: portmacro.h:89
os_ptimer ptimer
start address of a timer function
Definition: cmsis_os.h:340
uint32_t v
message as 32-bit value
Definition: cmsis_os.h:398
#define portNVIC_INT_CTRL_REG
Definition: portmacro.h:132
#define xQueueSend(xQueue, pvItemToQueue, xTicksToWait)
Definition: queue.h:521
PRIVILEGED_FUNCTION void vTaskSuspendAll(void)
Definition: tasks.c:1944
uint32_t pool_sz
Definition: cmsis_os.c:914
osMessageQId message_id
message id obtained by osMessageCreate
Definition: cmsis_os.h:404
#define xSemaphoreGive(xSemaphore)
Definition: semphr.h:489
uint32_t queue_sz
number of elements in the queue
Definition: cmsis_os.h:375
uint32_t item_sz
size of an item
Definition: cmsis_os.h:376
#define xQueueReceive(xQueue, pvBuffer, xTicksToWait)
Definition: queue.h:914
void * p
message or mail as void pointer
Definition: cmsis_os.h:399
PRIVILEGED_FUNCTION void vTaskList(char *pcWriteBuffer)
PRIVILEGED_FUNCTION void vTaskDelayUntil(TickType_t *const pxPreviousWakeTime, const TickType_t xTimeIncrement)
#define tskIDLE_PRIORITY
Definition: task.h:193
#define xQueuePeek(xQueue, pvBuffer, xTicksToWait)
Definition: queue.h:788
int32_t signals
signal flags
Definition: cmsis_os.h:400
PRIVILEGED_FUNCTION UBaseType_t uxTaskPriorityGetFromISR(TaskHandle_t xTask)
uint8_t info[12]
Definition: masstorage.h:54