Prusa MINI Firmware overview
cmsis_os.c File Reference

CMSIS-RTOS API implementation for FreeRTOS V9.0.0. More...

#include <string.h>
#include "cmsis_os.h"

Classes

struct  os_pool_cb
 
struct  os_mailQ_cb
 

Typedefs

typedef struct os_pool_cb os_pool_cb_t
 
typedef struct os_mailQ_cb os_mailQ_cb_t
 

Functions

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...
 
voidosPoolAlloc (osPoolId pool_id)
 Allocate a memory block from a memory pool. More...
 
voidosPoolCAlloc (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...
 
voidosMailAlloc (osMailQId queue_id, uint32_t millisec)
 Allocate a memory block from a mail. More...
 
voidosMailCAlloc (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...
 

Detailed Description

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:

  1. Redistribution of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  2. 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.
  3. 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.
  4. 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.
  5. 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.

Typedef Documentation

◆ os_pool_cb_t

typedef struct os_pool_cb os_pool_cb_t

◆ os_mailQ_cb_t

typedef struct os_mailQ_cb os_mailQ_cb_t

Function Documentation

◆ xPortSysTickHandler()

void xPortSysTickHandler ( void  )
494 {
495  /* The SysTick runs at the lowest interrupt priority, so when this interrupt
496  executes all interrupts must be unmasked. There is therefore no need to
497  save and then restore the interrupt mask value as its value is already
498  known. */
500  {
501  /* Increment the RTOS tick. */
502  if( xTaskIncrementTick() != pdFALSE )
503  {
504  /* A context switch is required. Context switching is performed in
505  the PendSV interrupt. Pend the PendSV interrupt. */
507  }
508  }
510 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ makeFreeRtosPriority()

static unsigned portBASE_TYPE makeFreeRtosPriority ( osPriority  priority)
static
147 {
148  unsigned portBASE_TYPE fpriority = tskIDLE_PRIORITY;
149 
150  if (priority != osPriorityError) {
151  fpriority += (priority - osPriorityIdle);
152  }
153 
154  return fpriority;
155 }
Here is the caller graph for this function:

◆ inHandlerMode()

static int inHandlerMode ( void  )
static
174 {
175  return __get_IPSR() != 0;
176 }
Here is the caller graph for this function:

◆ osKernelInitialize()

osStatus osKernelInitialize ( void  )

Initialize the RTOS Kernel for creating objects.

Return values
statuscode that indicates the execution status of the function.
Note
MUST REMAIN UNCHANGED: osKernelInitialize shall be consistent in every CMSIS-RTOS.

◆ osKernelStart()

osStatus osKernelStart ( void  )

Start the RTOS Kernel with executing the specified thread.

Parameters
thread_defthread definition referenced with osThread.
argumentpointer that is passed to the thread function as start argument.
Return values
statuscode that indicates the execution status of the function
Note
MUST REMAIN UNCHANGED: osKernelStart shall be consistent in every CMSIS-RTOS.
194 {
196 
197  return osOK;
198 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ osKernelRunning()

int32_t osKernelRunning ( void  )

Check if the RTOS kernel is already started.

Parameters
None
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.
209 {
210 #if ( ( INCLUDE_xTaskGetSchedulerState == 1 ) || ( configUSE_TIMERS == 1 ) )
212  return 0;
213  else
214  return 1;
215 #else
216  return (-1);
217 #endif
218 }
Here is the call graph for this function:

◆ osKernelSysTick()

uint32_t osKernelSysTick ( void  )

Get the value of the Kernel SysTick timer.

Parameters
None
Return values
None
Note
MUST REMAIN UNCHANGED: osKernelSysTick shall be consistent in every CMSIS-RTOS.
228 {
229  if (inHandlerMode()) {
230  return xTaskGetTickCountFromISR();
231  }
232  else {
233  return xTaskGetTickCount();
234  }
235 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ osThreadCreate()

osThreadId osThreadCreate ( const osThreadDef_t thread_def,
void argument 
)

Create a thread and add it to Active Threads and set it to state READY.

Parameters
thread_defthread definition referenced with osThread.
argumentpointer that is passed to the thread function as start argument.
Return values
threadID for reference by other functions or NULL in case of error.
Note
MUST REMAIN UNCHANGED: osThreadCreate shall be consistent in every CMSIS-RTOS.
246 {
247  TaskHandle_t handle;
248 
249 #if( configSUPPORT_STATIC_ALLOCATION == 1 ) && ( configSUPPORT_DYNAMIC_ALLOCATION == 1 )
250  if((thread_def->buffer != NULL) && (thread_def->controlblock != NULL)) {
251  handle = xTaskCreateStatic((TaskFunction_t)thread_def->pthread,(const portCHAR *)thread_def->name,
252  thread_def->stacksize, argument, makeFreeRtosPriority(thread_def->tpriority),
253  thread_def->buffer, thread_def->controlblock);
254  }
255  else {
256  if (xTaskCreate((TaskFunction_t)thread_def->pthread,(const portCHAR *)thread_def->name,
257  thread_def->stacksize, argument, makeFreeRtosPriority(thread_def->tpriority),
258  &handle) != pdPASS) {
259  return NULL;
260  }
261  }
262 #elif( configSUPPORT_STATIC_ALLOCATION == 1 )
263 
264  handle = xTaskCreateStatic((TaskFunction_t)thread_def->pthread,(const portCHAR *)thread_def->name,
265  thread_def->stacksize, argument, makeFreeRtosPriority(thread_def->tpriority),
266  thread_def->buffer, thread_def->controlblock);
267 #else
268  if (xTaskCreate((TaskFunction_t)thread_def->pthread,(const portCHAR *)thread_def->name,
269  thread_def->stacksize, argument, makeFreeRtosPriority(thread_def->tpriority),
270  &handle) != pdPASS) {
271  return NULL;
272  }
273 #endif
274 
275  return handle;
276 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ osThreadGetId()

osThreadId osThreadGetId ( void  )

Return the thread ID of the current running thread.

Return values
threadID for reference by other functions or NULL in case of error.
Note
MUST REMAIN UNCHANGED: osThreadGetId shall be consistent in every CMSIS-RTOS.
284 {
285 #if ( ( INCLUDE_xTaskGetCurrentTaskHandle == 1 ) || ( configUSE_MUTEXES == 1 ) )
286  return xTaskGetCurrentTaskHandle();
287 #else
288  return NULL;
289 #endif
290 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ osThreadTerminate()

osStatus osThreadTerminate ( osThreadId  thread_id)

Terminate execution of a thread and remove it from Active Threads.

Parameters
thread_idthread ID obtained by osThreadCreate or osThreadGetId.
Return values
statuscode that indicates the execution status of the function.
Note
MUST REMAIN UNCHANGED: osThreadTerminate shall be consistent in every CMSIS-RTOS.
299 {
300 #if (INCLUDE_vTaskDelete == 1)
301  vTaskDelete(thread_id);
302  return osOK;
303 #else
304  return osErrorOS;
305 #endif
306 }
Here is the call graph for this function:

◆ osThreadYield()

osStatus osThreadYield ( void  )

Pass control to next thread that is in state READY.

Return values
statuscode that indicates the execution status of the function.
Note
MUST REMAIN UNCHANGED: osThreadYield shall be consistent in every CMSIS-RTOS.
314 {
315  taskYIELD();
316 
317  return osOK;
318 }

◆ osThreadSetPriority()

osStatus osThreadSetPriority ( osThreadId  thread_id,
osPriority  priority 
)

Change priority of an active thread.

Parameters
thread_idthread ID obtained by osThreadCreate or osThreadGetId.
prioritynew priority value for the thread function.
Return values
statuscode that indicates the execution status of the function.
Note
MUST REMAIN UNCHANGED: osThreadSetPriority shall be consistent in every CMSIS-RTOS.
328 {
329 #if (INCLUDE_vTaskPrioritySet == 1)
330  vTaskPrioritySet(thread_id, makeFreeRtosPriority(priority));
331  return osOK;
332 #else
333  return osErrorOS;
334 #endif
335 }
Here is the call graph for this function:

◆ osThreadGetPriority()

osPriority osThreadGetPriority ( osThreadId  thread_id)

Get current priority of an active thread.

Parameters
thread_idthread ID obtained by osThreadCreate or osThreadGetId.
Return values
currentpriority value of the thread function.
Note
MUST REMAIN UNCHANGED: osThreadGetPriority shall be consistent in every CMSIS-RTOS.
344 {
345 #if (INCLUDE_uxTaskPriorityGet == 1)
346  if (inHandlerMode())
347  {
348  return makeCmsisPriority(uxTaskPriorityGetFromISR(thread_id));
349  }
350  else
351  {
352  return makeCmsisPriority(uxTaskPriorityGet(thread_id));
353  }
354 #else
355  return osPriorityError;
356 #endif
357 }
Here is the call graph for this function:

◆ osDelay()

osStatus osDelay ( uint32_t  millisec)

Wait for Timeout (Time Delay)

Parameters
millisectime delay value
Return values
statuscode that indicates the execution status of the function.
366 {
367 #if INCLUDE_vTaskDelay
368  TickType_t ticks = millisec / portTICK_PERIOD_MS;
369 
370  vTaskDelay(ticks ? ticks : 1); /* Minimum delay = 1 tick */
371 
372  return osOK;
373 #else
374  (void) millisec;
375 
376  return osErrorResource;
377 #endif
378 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ osTimerCreate()

osTimerId osTimerCreate ( const osTimerDef_t timer_def,
os_timer_type  type,
void argument 
)

Create a timer.

Parameters
timer_deftimer object referenced with osTimer.
typeosTimerOnce for one-shot or osTimerPeriodic for periodic behavior.
argumentargument to the timer call back function.
Return values
timerID for reference by other functions or NULL in case of error.
Note
MUST REMAIN UNCHANGED: osTimerCreate shall be consistent in every CMSIS-RTOS.
401 {
402 #if (configUSE_TIMERS == 1)
403 
404 #if( ( configSUPPORT_STATIC_ALLOCATION == 1 ) && ( configSUPPORT_DYNAMIC_ALLOCATION == 1 ) )
405  if(timer_def->controlblock != NULL) {
406  return xTimerCreateStatic((const char *)"",
407  1, // period should be filled when starting the Timer using osTimerStart
409  (void *) argument,
410  (TaskFunction_t)timer_def->ptimer,
411  (StaticTimer_t *)timer_def->controlblock);
412  }
413  else {
414  return xTimerCreate((const char *)"",
415  1, // period should be filled when starting the Timer using osTimerStart
417  (void *) argument,
418  (TaskFunction_t)timer_def->ptimer);
419  }
420 #elif( configSUPPORT_STATIC_ALLOCATION == 1 )
421  return xTimerCreateStatic((const char *)"",
422  1, // period should be filled when starting the Timer using osTimerStart
424  (void *) argument,
425  (TaskFunction_t)timer_def->ptimer,
426  (StaticTimer_t *)timer_def->controlblock);
427 #else
428  return xTimerCreate((const char *)"",
429  1, // period should be filled when starting the Timer using osTimerStart
431  (void *) argument,
432  (TaskFunction_t)timer_def->ptimer);
433 #endif
434 
435 #else
436  return NULL;
437 #endif
438 }

◆ osTimerStart()

osStatus osTimerStart ( osTimerId  timer_id,
uint32_t  millisec 
)

Start or restart a timer.

Parameters
timer_idtimer ID obtained by osTimerCreate.
millisectime delay value of the timer.
Return values
statuscode that indicates the execution status of the function
Note
MUST REMAIN UNCHANGED: osTimerStart shall be consistent in every CMSIS-RTOS.
448 {
449  osStatus result = osOK;
450 #if (configUSE_TIMERS == 1)
451  portBASE_TYPE taskWoken = pdFALSE;
452  TickType_t ticks = millisec / portTICK_PERIOD_MS;
453 
454  if (ticks == 0)
455  ticks = 1;
456 
457  if (inHandlerMode())
458  {
459  if (xTimerChangePeriodFromISR(timer_id, ticks, &taskWoken) != pdPASS)
460  {
461  result = osErrorOS;
462  }
463  else
464  {
465  portEND_SWITCHING_ISR(taskWoken);
466  }
467  }
468  else
469  {
470  if (xTimerChangePeriod(timer_id, ticks, 0) != pdPASS)
471  result = osErrorOS;
472  }
473 
474 #else
475  result = osErrorOS;
476 #endif
477  return result;
478 }
Here is the call graph for this function:

◆ osTimerStop()

osStatus osTimerStop ( osTimerId  timer_id)

Stop a timer.

Parameters
timer_idtimer ID obtained by osTimerCreate
Return values
statuscode that indicates the execution status of the function.
Note
MUST REMAIN UNCHANGED: osTimerStop shall be consistent in every CMSIS-RTOS.
487 {
488  osStatus result = osOK;
489 #if (configUSE_TIMERS == 1)
490  portBASE_TYPE taskWoken = pdFALSE;
491 
492  if (inHandlerMode()) {
493  if (xTimerStopFromISR(timer_id, &taskWoken) != pdPASS) {
494  return osErrorOS;
495  }
496  portEND_SWITCHING_ISR(taskWoken);
497  }
498  else {
499  if (xTimerStop(timer_id, 0) != pdPASS) {
500  result = osErrorOS;
501  }
502  }
503 #else
504  result = osErrorOS;
505 #endif
506  return result;
507 }
Here is the call graph for this function:

◆ osTimerDelete()

osStatus osTimerDelete ( osTimerId  timer_id)

Delete a timer.

Parameters
timer_idtimer ID obtained by osTimerCreate
Return values
statuscode that indicates the execution status of the function.
Note
MUST REMAIN UNCHANGED: osTimerDelete shall be consistent in every CMSIS-RTOS.
516 {
517 osStatus result = osOK;
518 
519 #if (configUSE_TIMERS == 1)
520 
521  if (inHandlerMode()) {
522  return osErrorISR;
523  }
524  else {
525  if ((xTimerDelete(timer_id, osWaitForever )) != pdPASS) {
526  result = osErrorOS;
527  }
528  }
529 
530 #else
531  result = osErrorOS;
532 #endif
533 
534  return result;
535 }
Here is the call graph for this function:

◆ osSignalSet()

int32_t osSignalSet ( osThreadId  thread_id,
int32_t  signal 
)

Set the specified Signal Flags of an active thread.

Parameters
thread_idthread ID obtained by osThreadCreate or osThreadGetId.
signalsspecifies the signal flags of the thread that should be set.
Return values
previoussignal flags of the specified thread or 0x80000000 in case of incorrect parameters.
Note
MUST REMAIN UNCHANGED: osSignalSet shall be consistent in every CMSIS-RTOS.
546 {
547 #if( configUSE_TASK_NOTIFICATIONS == 1 )
548  BaseType_t xHigherPriorityTaskWoken = pdFALSE;
549  uint32_t ulPreviousNotificationValue = 0;
550 
551  if (inHandlerMode())
552  {
553  if(xTaskGenericNotifyFromISR( thread_id , (uint32_t)signal, eSetBits, &ulPreviousNotificationValue, &xHigherPriorityTaskWoken ) != pdPASS )
554  return 0x80000000;
555 
556  portYIELD_FROM_ISR( xHigherPriorityTaskWoken );
557  }
558  else if(xTaskGenericNotify( thread_id , (uint32_t)signal, eSetBits, &ulPreviousNotificationValue) != pdPASS )
559  return 0x80000000;
560 
561  return ulPreviousNotificationValue;
562 #else
563  (void) thread_id;
564  (void) signal;
565 
566  return 0x80000000; /* Task Notification not supported */
567 #endif
568 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ osSignalClear()

int32_t osSignalClear ( osThreadId  thread_id,
int32_t  signal 
)

Clear the specified Signal Flags of an active thread.

Parameters
thread_idthread ID obtained by osThreadCreate or osThreadGetId.
signalsspecifies the signal flags of the thread that shall be cleared.
Return values
previoussignal 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
signalswait until all specified signal flags set or 0 for any single signal flag.
millisectimeout value or 0 in case of no time-out.
Return values
eventflag information or error code.
Note
MUST REMAIN UNCHANGED: osSignalWait shall be consistent in every CMSIS-RTOS.
587 {
588  osEvent ret;
589 
590 #if( configUSE_TASK_NOTIFICATIONS == 1 )
591 
592  TickType_t ticks;
593 
594  ret.value.signals = 0;
595  ticks = 0;
596  if (millisec == osWaitForever) {
597  ticks = portMAX_DELAY;
598  }
599  else if (millisec != 0) {
600  ticks = millisec / portTICK_PERIOD_MS;
601  if (ticks == 0) {
602  ticks = 1;
603  }
604  }
605 
606  if (inHandlerMode())
607  {
608  ret.status = osErrorISR; /*Not allowed in ISR*/
609  }
610  else
611  {
612  if(xTaskNotifyWait( 0,(uint32_t) signals, (uint32_t *)&ret.value.signals, ticks) != pdTRUE)
613  {
614  if(ticks == 0) ret.status = osOK;
615  else ret.status = osEventTimeout;
616  }
617  else if(ret.value.signals < 0)
618  {
619  ret.status = osErrorValue;
620  }
621  else ret.status = osEventSignal;
622  }
623 #else
624  (void) signals;
625  (void) millisec;
626 
627  ret.status = osErrorOS; /* Task Notification not supported */
628 #endif
629 
630  return ret;
631 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ osMutexCreate()

osMutexId osMutexCreate ( const osMutexDef_t mutex_def)

Create and Initialize a Mutex object.

Parameters
mutex_defmutex definition referenced with osMutex.
Return values
mutexID for reference by other functions or NULL in case of error.
Note
MUST REMAIN UNCHANGED: osMutexCreate shall be consistent in every CMSIS-RTOS.
641 {
642 #if ( configUSE_MUTEXES == 1)
643 
644 #if( configSUPPORT_STATIC_ALLOCATION == 1 ) && ( configSUPPORT_DYNAMIC_ALLOCATION == 1 )
645 
646  if (mutex_def->controlblock != NULL) {
647  return xSemaphoreCreateMutexStatic( mutex_def->controlblock );
648  }
649  else {
650  return xSemaphoreCreateMutex();
651  }
652 #elif ( configSUPPORT_STATIC_ALLOCATION == 1 )
653  return xSemaphoreCreateMutexStatic( mutex_def->controlblock );
654 #else
655  return xSemaphoreCreateMutex();
656 #endif
657 #else
658  return NULL;
659 #endif
660 }
Here is the caller graph for this function:

◆ osMutexWait()

osStatus osMutexWait ( osMutexId  mutex_id,
uint32_t  millisec 
)

Wait until a Mutex becomes available.

Parameters
mutex_idmutex ID obtained by osMutexCreate.
millisectimeout value or 0 in case of no time-out.
Return values
statuscode that indicates the execution status of the function.
Note
MUST REMAIN UNCHANGED: osMutexWait shall be consistent in every CMSIS-RTOS.
670 {
671  TickType_t ticks;
672  portBASE_TYPE taskWoken = pdFALSE;
673 
674 
675  if (mutex_id == NULL) {
676  return osErrorParameter;
677  }
678 
679  ticks = 0;
680  if (millisec == osWaitForever) {
681  ticks = portMAX_DELAY;
682  }
683  else if (millisec != 0) {
684  ticks = millisec / portTICK_PERIOD_MS;
685  if (ticks == 0) {
686  ticks = 1;
687  }
688  }
689 
690  if (inHandlerMode()) {
691  if (xSemaphoreTakeFromISR(mutex_id, &taskWoken) != pdTRUE) {
692  return osErrorOS;
693  }
694  portEND_SWITCHING_ISR(taskWoken);
695  }
696  else if (xSemaphoreTake(mutex_id, ticks) != pdTRUE) {
697  return osErrorOS;
698  }
699 
700  return osOK;
701 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ osMutexRelease()

osStatus osMutexRelease ( osMutexId  mutex_id)

Release a Mutex that was obtained by osMutexWait.

Parameters
mutex_idmutex ID obtained by osMutexCreate.
Return values
statuscode that indicates the execution status of the function.
Note
MUST REMAIN UNCHANGED: osMutexRelease shall be consistent in every CMSIS-RTOS.
710 {
711  osStatus result = osOK;
712  portBASE_TYPE taskWoken = pdFALSE;
713 
714  if (inHandlerMode()) {
715  if (xSemaphoreGiveFromISR(mutex_id, &taskWoken) != pdTRUE) {
716  return osErrorOS;
717  }
718  portEND_SWITCHING_ISR(taskWoken);
719  }
720  else if (xSemaphoreGive(mutex_id) != pdTRUE)
721  {
722  result = osErrorOS;
723  }
724  return result;
725 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ osMutexDelete()

osStatus osMutexDelete ( osMutexId  mutex_id)

Delete a Mutex.

Parameters
mutex_idmutex ID obtained by osMutexCreate.
Return values
statuscode that indicates the execution status of the function.
Note
MUST REMAIN UNCHANGED: osMutexDelete shall be consistent in every CMSIS-RTOS.
734 {
735  if (inHandlerMode()) {
736  return osErrorISR;
737  }
738 
739  vQueueDelete(mutex_id);
740 
741  return osOK;
742 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ osSemaphoreCreate()

osSemaphoreId osSemaphoreCreate ( const osSemaphoreDef_t semaphore_def,
int32_t  count 
)

Create and Initialize a Semaphore object used for managing resources.

Parameters
semaphore_defsemaphore definition referenced with osSemaphore.
countnumber of available resources.
Return values
semaphoreID for reference by other functions or NULL in case of error.
Note
MUST REMAIN UNCHANGED: osSemaphoreCreate shall be consistent in every CMSIS-RTOS.
756 {
757 #if( configSUPPORT_STATIC_ALLOCATION == 1 ) && ( configSUPPORT_DYNAMIC_ALLOCATION == 1 )
758 
759  osSemaphoreId sema;
760 
761  if (semaphore_def->controlblock != NULL){
762  if (count == 1) {
763  return xSemaphoreCreateBinaryStatic( semaphore_def->controlblock );
764  }
765  else {
766 #if (configUSE_COUNTING_SEMAPHORES == 1 )
767  return xSemaphoreCreateCountingStatic( count, count, semaphore_def->controlblock );
768 #else
769  return NULL;
770 #endif
771  }
772  }
773  else {
774  if (count == 1) {
775  vSemaphoreCreateBinary(sema);
776  return sema;
777  }
778  else {
779 #if (configUSE_COUNTING_SEMAPHORES == 1 )
780  return xSemaphoreCreateCounting(count, count);
781 #else
782  return NULL;
783 #endif
784  }
785  }
786 #elif ( configSUPPORT_STATIC_ALLOCATION == 1 ) // configSUPPORT_DYNAMIC_ALLOCATION == 0
787  if(count == 1) {
788  return xSemaphoreCreateBinaryStatic( semaphore_def->controlblock );
789  }
790  else
791  {
792 #if (configUSE_COUNTING_SEMAPHORES == 1 )
793  return xSemaphoreCreateCountingStatic( count, count, semaphore_def->controlblock );
794 #else
795  return NULL;
796 #endif
797  }
798 #else // configSUPPORT_STATIC_ALLOCATION == 0 && configSUPPORT_DYNAMIC_ALLOCATION == 1
799  osSemaphoreId sema;
800 
801  if (count == 1) {
802  vSemaphoreCreateBinary(sema);
803  return sema;
804  }
805  else {
806 #if (configUSE_COUNTING_SEMAPHORES == 1 )
807  return xSemaphoreCreateCounting(count, count);
808 #else
809  return NULL;
810 #endif
811  }
812 #endif
813 }
Here is the caller graph for this function:

◆ osSemaphoreWait()

int32_t osSemaphoreWait ( osSemaphoreId  semaphore_id,
uint32_t  millisec 
)

Wait until a Semaphore token becomes available.

Parameters
semaphore_idsemaphore object referenced with osSemaphore.
millisectimeout value or 0 in case of no time-out.
Return values
numberof available tokens, or -1 in case of incorrect parameters.
Note
MUST REMAIN UNCHANGED: osSemaphoreWait shall be consistent in every CMSIS-RTOS.
823 {
824  TickType_t ticks;
825  portBASE_TYPE taskWoken = pdFALSE;
826 
827 
828  if (semaphore_id == NULL) {
829  return osErrorParameter;
830  }
831 
832  ticks = 0;
833  if (millisec == osWaitForever) {
834  ticks = portMAX_DELAY;
835  }
836  else if (millisec != 0) {
837  ticks = millisec / portTICK_PERIOD_MS;
838  if (ticks == 0) {
839  ticks = 1;
840  }
841  }
842 
843  if (inHandlerMode()) {
844  if (xSemaphoreTakeFromISR(semaphore_id, &taskWoken) != pdTRUE) {
845  return osErrorOS;
846  }
847  portEND_SWITCHING_ISR(taskWoken);
848  }
849  else if (xSemaphoreTake(semaphore_id, ticks) != pdTRUE) {
850  return osErrorOS;
851  }
852 
853  return osOK;
854 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ osSemaphoreRelease()

osStatus osSemaphoreRelease ( osSemaphoreId  semaphore_id)

Release a Semaphore token.

Parameters
semaphore_idsemaphore object referenced with osSemaphore.
Return values
statuscode that indicates the execution status of the function.
Note
MUST REMAIN UNCHANGED: osSemaphoreRelease shall be consistent in every CMSIS-RTOS.
863 {
864  osStatus result = osOK;
865  portBASE_TYPE taskWoken = pdFALSE;
866 
867 
868  if (inHandlerMode()) {
869  if (xSemaphoreGiveFromISR(semaphore_id, &taskWoken) != pdTRUE) {
870  return osErrorOS;
871  }
872  portEND_SWITCHING_ISR(taskWoken);
873  }
874  else {
875  if (xSemaphoreGive(semaphore_id) != pdTRUE) {
876  result = osErrorOS;
877  }
878  }
879 
880  return result;
881 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ osSemaphoreDelete()

osStatus osSemaphoreDelete ( osSemaphoreId  semaphore_id)

Delete a Semaphore.

Parameters
semaphore_idsemaphore object referenced with osSemaphore.
Return values
statuscode that indicates the execution status of the function.
Note
MUST REMAIN UNCHANGED: osSemaphoreDelete shall be consistent in every CMSIS-RTOS.
890 {
891  if (inHandlerMode()) {
892  return osErrorISR;
893  }
894 
895  vSemaphoreDelete(semaphore_id);
896 
897  return osOK;
898 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ osPoolCreate()

osPoolId osPoolCreate ( const osPoolDef_t pool_def)

Create and Initialize a memory pool.

Parameters
pool_defmemory pool definition referenced with osPool.
Return values
memorypool ID for reference by other functions or NULL in case of error.
Note
MUST REMAIN UNCHANGED: osPoolCreate shall be consistent in every CMSIS-RTOS.
927 {
928 #if (configSUPPORT_DYNAMIC_ALLOCATION == 1)
929  osPoolId thePool;
930  int itemSize = 4 * ((pool_def->item_sz + 3) / 4);
931  uint32_t i;
932 
933  /* First have to allocate memory for the pool control block. */
934  thePool = pvPortMalloc(sizeof(os_pool_cb_t));
935 
936 
937  if (thePool) {
938  thePool->pool_sz = pool_def->pool_sz;
939  thePool->item_sz = itemSize;
940  thePool->currentIndex = 0;
941 
942  /* Memory for markers */
943  thePool->markers = pvPortMalloc(pool_def->pool_sz);
944 
945  if (thePool->markers) {
946  /* Now allocate the pool itself. */
947  thePool->pool = pvPortMalloc(pool_def->pool_sz * itemSize);
948 
949  if (thePool->pool) {
950  for (i = 0; i < pool_def->pool_sz; i++) {
951  thePool->markers[i] = 0;
952  }
953  }
954  else {
955  vPortFree(thePool->markers);
956  vPortFree(thePool);
957  thePool = NULL;
958  }
959  }
960  else {
961  vPortFree(thePool);
962  thePool = NULL;
963  }
964  }
965 
966  return thePool;
967 
968 #else
969  return NULL;
970 #endif
971 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ osPoolAlloc()

void* osPoolAlloc ( osPoolId  pool_id)

Allocate a memory block from a memory pool.

Parameters
pool_idmemory pool ID obtain referenced with osPoolCreate.
Return values
addressof the allocated memory block or NULL in case of no memory available.
Note
MUST REMAIN UNCHANGED: osPoolAlloc shall be consistent in every CMSIS-RTOS.
980 {
981  int dummy = 0;
982  void *p = NULL;
983  uint32_t i;
984  uint32_t index;
985 
986  if (inHandlerMode()) {
988  }
989  else {
991  }
992 
993  for (i = 0; i < pool_id->pool_sz; i++) {
994  index = pool_id->currentIndex + i;
995  if (index >= pool_id->pool_sz) {
996  index = 0;
997  }
998 
999  if (pool_id->markers[index] == 0) {
1000  pool_id->markers[index] = 1;
1001  p = (void *)((uint32_t)(pool_id->pool) + (index * pool_id->item_sz));
1002  pool_id->currentIndex = index;
1003  break;
1004  }
1005  }
1006 
1007  if (inHandlerMode()) {
1009  }
1010  else {
1012  }
1013 
1014  return p;
1015 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ osPoolCAlloc()

void* osPoolCAlloc ( osPoolId  pool_id)

Allocate a memory block from a memory pool and set memory block to zero.

Parameters
pool_idmemory pool ID obtain referenced with osPoolCreate.
Return values
addressof the allocated memory block or NULL in case of no memory available.
Note
MUST REMAIN UNCHANGED: osPoolCAlloc shall be consistent in every CMSIS-RTOS.
1024 {
1025  void *p = osPoolAlloc(pool_id);
1026 
1027  if (p != NULL)
1028  {
1029  memset(p, 0, sizeof(pool_id->pool_sz));
1030  }
1031 
1032  return p;
1033 }
Here is the call graph for this function:

◆ osPoolFree()

osStatus osPoolFree ( osPoolId  pool_id,
void block 
)

Return an allocated memory block back to a specific memory pool.

Parameters
pool_idmemory pool ID obtain referenced with osPoolCreate.
blockaddress of the allocated memory block that is returned to the memory pool.
Return values
statuscode that indicates the execution status of the function.
Note
MUST REMAIN UNCHANGED: osPoolFree shall be consistent in every CMSIS-RTOS.
1043 {
1044  uint32_t index;
1045 
1046  if (pool_id == NULL) {
1047  return osErrorParameter;
1048  }
1049 
1050  if (block == NULL) {
1051  return osErrorParameter;
1052  }
1053 
1054  if (block < pool_id->pool) {
1055  return osErrorParameter;
1056  }
1057 
1058  index = (uint32_t)block - (uint32_t)(pool_id->pool);
1059  if (index % pool_id->item_sz) {
1060  return osErrorParameter;
1061  }
1062  index = index / pool_id->item_sz;
1063  if (index >= pool_id->pool_sz) {
1064  return osErrorParameter;
1065  }
1066 
1067  pool_id->markers[index] = 0;
1068 
1069  return osOK;
1070 }
Here is the caller graph for this function:

◆ osMessageCreate()

osMessageQId osMessageCreate ( const osMessageQDef_t queue_def,
osThreadId  thread_id 
)

Create and Initialize a Message Queue.

Parameters
queue_defqueue definition referenced with osMessageQ.
thread_idthread ID (obtained by osThreadCreate or osThreadGetId) or NULL.
Return values
messagequeue ID for reference by other functions or NULL in case of error.
Note
MUST REMAIN UNCHANGED: osMessageCreate shall be consistent in every CMSIS-RTOS.
1087 {
1088  (void) thread_id;
1089 
1090 #if( configSUPPORT_STATIC_ALLOCATION == 1 ) && ( configSUPPORT_DYNAMIC_ALLOCATION == 1 )
1091 
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);
1094  }
1095  else {
1096  return xQueueCreate(queue_def->queue_sz, queue_def->item_sz);
1097  }
1098 #elif ( configSUPPORT_STATIC_ALLOCATION == 1 )
1099  return xQueueCreateStatic(queue_def->queue_sz, queue_def->item_sz, queue_def->buffer, queue_def->controlblock);
1100 #else
1101  return xQueueCreate(queue_def->queue_sz, queue_def->item_sz);
1102 #endif
1103 }
Here is the caller graph for this function:

◆ osMessagePut()

osStatus osMessagePut ( osMessageQId  queue_id,
uint32_t  info,
uint32_t  millisec 
)

Put a Message to a Queue.

Parameters
queue_idmessage queue ID obtained with osMessageCreate.
infomessage information.
millisectimeout value or 0 in case of no time-out.
Return values
statuscode that indicates the execution status of the function.
Note
MUST REMAIN UNCHANGED: osMessagePut shall be consistent in every CMSIS-RTOS.
1114 {
1115  portBASE_TYPE taskWoken = pdFALSE;
1116  TickType_t ticks;
1117 
1118  ticks = millisec / portTICK_PERIOD_MS;
1119  if (ticks == 0) {
1120  ticks = 1;
1121  }
1122 
1123  if (inHandlerMode()) {
1124  if (xQueueSendFromISR(queue_id, &info, &taskWoken) != pdTRUE) {
1125  return osErrorOS;
1126  }
1127  portEND_SWITCHING_ISR(taskWoken);
1128  }
1129  else {
1130  if (xQueueSend(queue_id, &info, ticks) != pdTRUE) {
1131  return osErrorOS;
1132  }
1133  }
1134 
1135  return osOK;
1136 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ osMessageGet()

osEvent osMessageGet ( osMessageQId  queue_id,
uint32_t  millisec 
)

Get a Message or Wait for a Message from a Queue.

Parameters
queue_idmessage queue ID obtained with osMessageCreate.
millisectimeout value or 0 in case of no time-out.
Return values
eventinformation that includes status code.
Note
MUST REMAIN UNCHANGED: osMessageGet shall be consistent in every CMSIS-RTOS.
1146 {
1147  portBASE_TYPE taskWoken;
1148  TickType_t ticks;
1149  osEvent event;
1150 
1151  event.def.message_id = queue_id;
1152  event.value.v = 0;
1153 
1154  if (queue_id == NULL) {
1155  event.status = osErrorParameter;
1156  return event;
1157  }
1158 
1159  taskWoken = pdFALSE;
1160 
1161  ticks = 0;
1162  if (millisec == osWaitForever) {
1163  ticks = portMAX_DELAY;
1164  }
1165  else if (millisec != 0) {
1166  ticks = millisec / portTICK_PERIOD_MS;
1167  if (ticks == 0) {
1168  ticks = 1;
1169  }
1170  }
1171 
1172  if (inHandlerMode()) {
1173  if (xQueueReceiveFromISR(queue_id, &event.value.v, &taskWoken) == pdTRUE) {
1174  /* We have mail */
1175  event.status = osEventMessage;
1176  }
1177  else {
1178  event.status = osOK;
1179  }
1180  portEND_SWITCHING_ISR(taskWoken);
1181  }
1182  else {
1183  if (xQueueReceive(queue_id, &event.value.v, ticks) == pdTRUE) {
1184  /* We have mail */
1185  event.status = osEventMessage;
1186  }
1187  else {
1188  event.status = (ticks == 0) ? osOK : osEventTimeout;
1189  }
1190  }
1191 
1192  return event;
1193 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ osMailCreate()

osMailQId osMailCreate ( const osMailQDef_t queue_def,
osThreadId  thread_id 
)

Create and Initialize mail queue.

Parameters
queue_defreference to the mail queue definition obtain with osMailQ
thread_idthread ID (obtained by osThreadCreate or osThreadGetId) or NULL.
Return values
mailqueue ID for reference by other functions or NULL in case of error.
Note
MUST REMAIN UNCHANGED: osMailCreate shall be consistent in every CMSIS-RTOS.
1215 {
1216 #if (configSUPPORT_DYNAMIC_ALLOCATION == 1)
1217  (void) thread_id;
1218 
1219  osPoolDef_t pool_def = {queue_def->queue_sz, queue_def->item_sz, NULL};
1220 
1221  /* Create a mail queue control block */
1222 
1223  *(queue_def->cb) = pvPortMalloc(sizeof(struct os_mailQ_cb));
1224 
1225  if (*(queue_def->cb) == NULL) {
1226  return NULL;
1227  }
1228  (*(queue_def->cb))->queue_def = queue_def;
1229 
1230  /* Create a queue in FreeRTOS */
1231  (*(queue_def->cb))->handle = xQueueCreate(queue_def->queue_sz, sizeof(void *));
1232 
1233 
1234  if ((*(queue_def->cb))->handle == NULL) {
1235  vPortFree(*(queue_def->cb));
1236  return NULL;
1237  }
1238 
1239  /* Create a mail pool */
1240  (*(queue_def->cb))->pool = osPoolCreate(&pool_def);
1241  if ((*(queue_def->cb))->pool == NULL) {
1242  //TODO: Delete queue. How to do it in FreeRTOS?
1243  vPortFree(*(queue_def->cb));
1244  return NULL;
1245  }
1246 
1247  return *(queue_def->cb);
1248 #else
1249  return NULL;
1250 #endif
1251 }
Here is the call graph for this function:

◆ osMailAlloc()

void* osMailAlloc ( osMailQId  queue_id,
uint32_t  millisec 
)

Allocate a memory block from a mail.

Parameters
queue_idmail queue ID obtained with osMailCreate.
millisectimeout value or 0 in case of no time-out.
Return values
pointerto 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.
1261 {
1262  (void) millisec;
1263  void *p;
1264 
1265 
1266  if (queue_id == NULL) {
1267  return NULL;
1268  }
1269 
1270  p = osPoolAlloc(queue_id->pool);
1271 
1272  return p;
1273 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ osMailCAlloc()

void* osMailCAlloc ( osMailQId  queue_id,
uint32_t  millisec 
)

Allocate a memory block from a mail and set memory block to zero.

Parameters
queue_idmail queue ID obtained with osMailCreate.
millisectimeout value or 0 in case of no time-out.
Return values
pointerto 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.
1283 {
1284  uint32_t i;
1285  void *p = osMailAlloc(queue_id, millisec);
1286 
1287  if (p) {
1288  for (i = 0; i < queue_id->queue_def->item_sz; i++) {
1289  ((uint8_t *)p)[i] = 0;
1290  }
1291  }
1292 
1293  return p;
1294 }
Here is the call graph for this function:

◆ osMailPut()

osStatus osMailPut ( osMailQId  queue_id,
void mail 
)

Put a mail to a queue.

Parameters
queue_idmail queue ID obtained with osMailCreate.
mailmemory block previously allocated with osMailAlloc or osMailCAlloc.
Return values
statuscode that indicates the execution status of the function.
Note
MUST REMAIN UNCHANGED: osMailPut shall be consistent in every CMSIS-RTOS.
1304 {
1305  portBASE_TYPE taskWoken;
1306 
1307 
1308  if (queue_id == NULL) {
1309  return osErrorParameter;
1310  }
1311 
1312  taskWoken = pdFALSE;
1313 
1314  if (inHandlerMode()) {
1315  if (xQueueSendFromISR(queue_id->handle, &mail, &taskWoken) != pdTRUE) {
1316  return osErrorOS;
1317  }
1318  portEND_SWITCHING_ISR(taskWoken);
1319  }
1320  else {
1321  if (xQueueSend(queue_id->handle, &mail, 0) != pdTRUE) {
1322  return osErrorOS;
1323  }
1324  }
1325 
1326  return osOK;
1327 }
Here is the call graph for this function:

◆ osMailGet()

osEvent osMailGet ( osMailQId  queue_id,
uint32_t  millisec 
)

Get a mail from a queue.

Parameters
queue_idmail queue ID obtained with osMailCreate.
millisectimeout value or 0 in case of no time-out
Return values
eventthat contains mail information or error code.
Note
MUST REMAIN UNCHANGED: osMailGet shall be consistent in every CMSIS-RTOS.
1337 {
1338  portBASE_TYPE taskWoken;
1339  TickType_t ticks;
1340  osEvent event;
1341 
1342  event.def.mail_id = queue_id;
1343 
1344  if (queue_id == NULL) {
1345  event.status = osErrorParameter;
1346  return event;
1347  }
1348 
1349  taskWoken = pdFALSE;
1350 
1351  ticks = 0;
1352  if (millisec == osWaitForever) {
1353  ticks = portMAX_DELAY;
1354  }
1355  else if (millisec != 0) {
1356  ticks = millisec / portTICK_PERIOD_MS;
1357  if (ticks == 0) {
1358  ticks = 1;
1359  }
1360  }
1361 
1362  if (inHandlerMode()) {
1363  if (xQueueReceiveFromISR(queue_id->handle, &event.value.p, &taskWoken) == pdTRUE) {
1364  /* We have mail */
1365  event.status = osEventMail;
1366  }
1367  else {
1368  event.status = osOK;
1369  }
1370  portEND_SWITCHING_ISR(taskWoken);
1371  }
1372  else {
1373  if (xQueueReceive(queue_id->handle, &event.value.p, ticks) == pdTRUE) {
1374  /* We have mail */
1375  event.status = osEventMail;
1376  }
1377  else {
1378  event.status = (ticks == 0) ? osOK : osEventTimeout;
1379  }
1380  }
1381 
1382  return event;
1383 }
Here is the call graph for this function:

◆ osMailFree()

osStatus osMailFree ( osMailQId  queue_id,
void mail 
)

Free a memory block from a mail.

Parameters
queue_idmail queue ID obtained with osMailCreate.
mailpointer to the memory block that was obtained with osMailGet.
Return values
statuscode that indicates the execution status of the function.
Note
MUST REMAIN UNCHANGED: osMailFree shall be consistent in every CMSIS-RTOS.
1393 {
1394  if (queue_id == NULL) {
1395  return osErrorParameter;
1396  }
1397 
1398  return osPoolFree(queue_id->pool, mail);
1399 }
Here is the call graph for this function:

◆ osSystickHandler()

void osSystickHandler ( void  )

Handles the tick increment.

Parameters
none.
Return values
none.
1409 {
1410 
1411 #if (INCLUDE_xTaskGetSchedulerState == 1 )
1413  {
1414 #endif /* INCLUDE_xTaskGetSchedulerState */
1416 #if (INCLUDE_xTaskGetSchedulerState == 1 )
1417  }
1418 #endif /* INCLUDE_xTaskGetSchedulerState */
1419 }
Here is the call graph for this function:

◆ osThreadSuspend()

osStatus osThreadSuspend ( osThreadId  thread_id)

Suspend execution of a thread.

Parameters
thread_idthread ID obtained by osThreadCreate or osThreadGetId.
Return values
statuscode that indicates the execution status of the function.
1479 {
1480 #if (INCLUDE_vTaskSuspend == 1)
1481  vTaskSuspend(thread_id);
1482 
1483  return osOK;
1484 #else
1485  return osErrorResource;
1486 #endif
1487 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ osThreadResume()

osStatus osThreadResume ( osThreadId  thread_id)

Resume execution of a suspended thread.

Parameters
thread_idthread ID obtained by osThreadCreate or osThreadGetId.
Return values
statuscode that indicates the execution status of the function.
1495 {
1496 #if (INCLUDE_vTaskSuspend == 1)
1497  if(inHandlerMode())
1498  {
1499  if (xTaskResumeFromISR(thread_id) == pdTRUE)
1500  {
1502  }
1503  }
1504  else
1505  {
1506  vTaskResume(thread_id);
1507  }
1508  return osOK;
1509 #else
1510  return osErrorResource;
1511 #endif
1512 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ osThreadSuspendAll()

osStatus osThreadSuspendAll ( void  )

Suspend execution of a all active threads.

Return values
statuscode that indicates the execution status of the function.
1519 {
1520  vTaskSuspendAll();
1521 
1522  return osOK;
1523 }
Here is the call graph for this function:

◆ osThreadResumeAll()

osStatus osThreadResumeAll ( void  )

Resume execution of a all suspended threads.

Return values
statuscode that indicates the execution status of the function.
1530 {
1531  if (xTaskResumeAll() == pdTRUE)
1532  return osOK;
1533  else
1534  return osErrorOS;
1535 
1536 }
Here is the call graph for this function:

◆ osDelayUntil()

osStatus osDelayUntil ( uint32_t *  PreviousWakeTime,
uint32_t  millisec 
)

Delay a task until a specified time.

Parameters
PreviousWakeTimePointer 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() )
millisectime delay value
Return values
statuscode that indicates the execution status of the function.
1547 {
1548 #if INCLUDE_vTaskDelayUntil
1549  TickType_t ticks = (millisec / portTICK_PERIOD_MS);
1550  vTaskDelayUntil((TickType_t *) PreviousWakeTime, ticks ? ticks : 1);
1551 
1552  return osOK;
1553 #else
1554  (void) millisec;
1555  (void) PreviousWakeTime;
1556 
1557  return osErrorResource;
1558 #endif
1559 }
Here is the call graph for this function:

◆ osAbortDelay()

osStatus osAbortDelay ( osThreadId  thread_id)

Abort the delay for a specific thread.

Parameters
thread_idthread ID obtained by osThreadCreate or osThreadGetId
Return values
statuscode that indicates the execution status of the function.
1567 {
1568 #if INCLUDE_xTaskAbortDelay
1569 
1570  xTaskAbortDelay(thread_id);
1571 
1572  return osOK;
1573 #else
1574  (void) thread_id;
1575 
1576  return osErrorResource;
1577 #endif
1578 }
Here is the call graph for this function:

◆ osThreadList()

osStatus osThreadList ( uint8_t buffer)

Lists all the current threads, along with their current state and stack usage high water mark.

Parameters
bufferA buffer into which the above mentioned details will be written
Return values
statuscode that indicates the execution status of the function.
1588 {
1589 #if ( ( configUSE_TRACE_FACILITY == 1 ) && ( configUSE_STATS_FORMATTING_FUNCTIONS == 1 ) )
1590  vTaskList((char *)buffer);
1591 #endif
1592  return osOK;
1593 }
Here is the call graph for this function:

◆ osMessagePeek()

osEvent osMessagePeek ( osMessageQId  queue_id,
uint32_t  millisec 
)

Receive an item from a queue without removing the item from the queue.

Parameters
queue_idmessage queue ID obtained with osMessageCreate.
millisectimeout value or 0 in case of no time-out.
Return values
eventinformation that includes status code.
1602 {
1603  TickType_t ticks;
1604  osEvent event;
1605 
1606  event.def.message_id = queue_id;
1607 
1608  if (queue_id == NULL) {
1609  event.status = osErrorParameter;
1610  return event;
1611  }
1612 
1613  ticks = 0;
1614  if (millisec == osWaitForever) {
1615  ticks = portMAX_DELAY;
1616  }
1617  else if (millisec != 0) {
1618  ticks = millisec / portTICK_PERIOD_MS;
1619  if (ticks == 0) {
1620  ticks = 1;
1621  }
1622  }
1623 
1624  if (xQueuePeek(queue_id, &event.value.v, ticks) == pdTRUE)
1625  {
1626  /* We have mail */
1627  event.status = osEventMessage;
1628  }
1629  else
1630  {
1631  event.status = (ticks == 0) ? osOK : osEventTimeout;
1632  }
1633 
1634  return event;
1635 }

◆ osMessageWaiting()

uint32_t osMessageWaiting ( osMessageQId  queue_id)

Get the number of messaged stored in a queue.

Parameters
queue_idmessage queue ID obtained with osMessageCreate.
Return values
numberof messages stored in a queue.
1643 {
1644  if (inHandlerMode()) {
1645  return uxQueueMessagesWaitingFromISR(queue_id);
1646  }
1647  else
1648  {
1649  return uxQueueMessagesWaiting(queue_id);
1650  }
1651 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ osMessageAvailableSpace()

uint32_t osMessageAvailableSpace ( osMessageQId  queue_id)

Get the available space in a message queue.

Parameters
queue_idmessage queue ID obtained with osMessageCreate.
Return values
availablespace in a message queue.
1659 {
1660  return uxQueueSpacesAvailable(queue_id);
1661 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ osMessageDelete()

osStatus osMessageDelete ( osMessageQId  queue_id)

Delete a Message Queue.

Parameters
queue_idmessage queue ID obtained with osMessageCreate.
Return values
statuscode that indicates the execution status of the function.
1669 {
1670  if (inHandlerMode()) {
1671  return osErrorISR;
1672  }
1673 
1674  vQueueDelete(queue_id);
1675 
1676  return osOK;
1677 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ osRecursiveMutexCreate()

osMutexId osRecursiveMutexCreate ( const osMutexDef_t mutex_def)

Create and Initialize a Recursive Mutex.

Parameters
mutex_defmutex definition referenced with osMutex.
Return values
mutexID for reference by other functions or NULL in case of error..
1685 {
1686 #if (configUSE_RECURSIVE_MUTEXES == 1)
1687 #if( configSUPPORT_STATIC_ALLOCATION == 1 ) && ( configSUPPORT_DYNAMIC_ALLOCATION == 1 )
1688 
1689  if (mutex_def->controlblock != NULL){
1690  return xSemaphoreCreateRecursiveMutexStatic( mutex_def->controlblock );
1691  }
1692  else {
1693  return xSemaphoreCreateRecursiveMutex();
1694  }
1695 #elif ( configSUPPORT_STATIC_ALLOCATION == 1 )
1696  return xSemaphoreCreateRecursiveMutexStatic( mutex_def->controlblock );
1697 #else
1698  return xSemaphoreCreateRecursiveMutex();
1699 #endif
1700 #else
1701  return NULL;
1702 #endif
1703 }

◆ osRecursiveMutexRelease()

osStatus osRecursiveMutexRelease ( osMutexId  mutex_id)

Release a Recursive Mutex.

Parameters
mutex_idmutex ID obtained by osRecursiveMutexCreate.
Return values
statuscode that indicates the execution status of the function.
1711 {
1712 #if (configUSE_RECURSIVE_MUTEXES == 1)
1713  osStatus result = osOK;
1714 
1715  if (xSemaphoreGiveRecursive(mutex_id) != pdTRUE)
1716  {
1717  result = osErrorOS;
1718  }
1719  return result;
1720 #else
1721  return osErrorResource;
1722 #endif
1723 }

◆ osRecursiveMutexWait()

osStatus osRecursiveMutexWait ( osMutexId  mutex_id,
uint32_t  millisec 
)

Release a Recursive Mutex.

Parameters
mutex_idmutex ID obtained by osRecursiveMutexCreate.
millisectimeout value or 0 in case of no time-out.
Return values
statuscode that indicates the execution status of the function.
1732 {
1733 #if (configUSE_RECURSIVE_MUTEXES == 1)
1734  TickType_t ticks;
1735 
1736  if (mutex_id == NULL)
1737  {
1738  return osErrorParameter;
1739  }
1740 
1741  ticks = 0;
1742  if (millisec == osWaitForever)
1743  {
1744  ticks = portMAX_DELAY;
1745  }
1746  else if (millisec != 0)
1747  {
1748  ticks = millisec / portTICK_PERIOD_MS;
1749  if (ticks == 0)
1750  {
1751  ticks = 1;
1752  }
1753  }
1754 
1755  if (xSemaphoreTakeRecursive(mutex_id, ticks) != pdTRUE)
1756  {
1757  return osErrorOS;
1758  }
1759  return osOK;
1760 #else
1761  return osErrorResource;
1762 #endif
1763 }

◆ osSemaphoreGetCount()

uint32_t osSemaphoreGetCount ( osSemaphoreId  semaphore_id)

Returns the current count value of a counting semaphore.

Parameters
semaphore_idsemaphore_id ID obtained by osSemaphoreCreate.
Return values
countvalue
1771 {
1772  return uxSemaphoreGetCount(semaphore_id);
1773 }
os_pool_cb::pool
void * pool
Definition: cmsis_os.c:912
os_mailQ_cb::handle
QueueHandle_t handle
Definition: cmsis_os.c:1203
os_thread_def::tpriority
osPriority tpriority
initial thread priority
Definition: cmsis_os.h:328
os_mailQ_cb::pool
osPoolId pool
Definition: cmsis_os.c:1204
os_mailQ_cb::queue_def
const osMailQDef_t * queue_def
Definition: cmsis_os.c:1202
os_mailQ_cb
Definition: cmsis_os.c:1201
portMAX_DELAY
#define portMAX_DELAY
Definition: portmacro.h:106
portSET_INTERRUPT_MASK_FROM_ISR
#define portSET_INTERRUPT_MASK_FROM_ISR()
Definition: FreeRTOS.h:300
xTaskGenericNotifyFromISR
PRIVILEGED_FUNCTION BaseType_t xTaskGenericNotifyFromISR(TaskHandle_t xTaskToNotify, uint32_t ulValue, eNotifyAction eAction, uint32_t *pulPreviousNotificationValue, BaseType_t *pxHigherPriorityTaskWoken)
xTaskGetSchedulerState
PRIVILEGED_FUNCTION BaseType_t xTaskGetSchedulerState(void)
xTaskNotifyWait
PRIVILEGED_FUNCTION BaseType_t xTaskNotifyWait(uint32_t ulBitsToClearOnEntry, uint32_t ulBitsToClearOnExit, uint32_t *pulNotificationValue, TickType_t xTicksToWait)
xTaskGenericNotify
PRIVILEGED_FUNCTION BaseType_t xTaskGenericNotify(TaskHandle_t xTaskToNotify, uint32_t ulValue, eNotifyAction eAction, uint32_t *pulPreviousNotificationValue)
uxQueueSpacesAvailable
PRIVILEGED_FUNCTION UBaseType_t uxQueueSpacesAvailable(const QueueHandle_t xQueue)
Definition: queue.c:1595
vTaskStartScheduler
PRIVILEGED_FUNCTION void vTaskStartScheduler(void)
Definition: tasks.c:1826
pvPortMalloc
PRIVILEGED_FUNCTION void * pvPortMalloc(size_t xSize)
Definition: heap_4.c:155
os_mailQ_def::item_sz
uint32_t item_sz
size of an item
Definition: cmsis_os.h:388
osPoolAlloc
void * osPoolAlloc(osPoolId pool_id)
Allocate a memory block from a memory pool.
Definition: cmsis_os.c:979
type
uint8_t type
Definition: UsbCore.h:184
xSemaphoreTake
#define xSemaphoreTake(xSemaphore, xBlockTime)
Definition: semphr.h:331
osStatus
osStatus
Definition: cmsis_os.h:234
os_thread_def::stacksize
uint32_t stacksize
stack size requirements in bytes; 0 is default stack size
Definition: cmsis_os.h:330
os_pool_cb::item_sz
uint32_t item_sz
Definition: cmsis_os.c:915
osEventTimeout
function completed; timeout occurred.
Definition: cmsis_os.h:239
xTaskGetTickCountFromISR
PRIVILEGED_FUNCTION TickType_t xTaskGetTickCountFromISR(void)
Definition: tasks.c:2142
xSemaphoreTakeFromISR
#define xSemaphoreTakeFromISR(xSemaphore, pxHigherPriorityTaskWoken)
Definition: semphr.h:700
i
uint8_t i
Definition: screen_test_graph.c:72
xTimerStopFromISR
#define xTimerStopFromISR(xTimer, pxHigherPriorityTaskWoken)
Definition: timers.h:978
osErrorISR
not allowed in ISR context: the function cannot be called from interrupt service routines.
Definition: cmsis_os.h:243
xTaskGetTickCount
PRIVILEGED_FUNCTION TickType_t xTaskGetTickCount(void)
Definition: tasks.c:2127
osPriorityIdle
priority: idle (lowest)
Definition: cmsis_os.h:218
xSemaphoreGiveFromISR
#define xSemaphoreGiveFromISR(xSemaphore, pxHigherPriorityTaskWoken)
Definition: semphr.h:666
eSetBits
Definition: task.h:126
xTimerStop
#define xTimerStop(xTimer, xTicksToWait)
Definition: timers.h:587
NULL
#define NULL
Definition: usbd_def.h:53
osEvent::status
osStatus status
status code: event or error information
Definition: cmsis_os.h:396
vPortEnterCritical
void vPortEnterCritical(void)
Definition: port.c:407
vTaskSuspend
PRIVILEGED_FUNCTION void vTaskSuspend(TaskHandle_t xTaskToSuspend)
pdPASS
#define pdPASS
Definition: projdefs.h:89
xTaskAbortDelay
PRIVILEGED_FUNCTION BaseType_t xTaskAbortDelay(TaskHandle_t xTask)
os_pool_cb::currentIndex
uint32_t currentIndex
Definition: cmsis_os.c:916
TickType_t
uint32_t TickType_t
Definition: portmacro.h:105
osErrorResource
resource not available: a specified resource was not available.
Definition: cmsis_os.h:241
osSemaphoreId
SemaphoreHandle_t osSemaphoreId
Definition: cmsis_os.h:295
osEventMail
function completed; mail event occurred.
Definition: cmsis_os.h:238
xTaskResumeFromISR
PRIVILEGED_FUNCTION BaseType_t xTaskResumeFromISR(TaskHandle_t xTaskToResume)
osEvent
Definition: cmsis_os.h:395
TaskHandle_t
void * TaskHandle_t
Definition: task.h:103
osPoolFree
osStatus osPoolFree(osPoolId pool_id, void *block)
Return an allocated memory block back to a specific memory pool.
Definition: cmsis_os.c:1042
osPriorityError
system cannot determine priority or thread has illegal priority
Definition: cmsis_os.h:225
pdFALSE
#define pdFALSE
Definition: projdefs.h:86
vTaskDelete
PRIVILEGED_FUNCTION void vTaskDelete(TaskHandle_t xTaskToDelete)
os_pool_def::pool_sz
uint32_t pool_sz
number of items (elements) in the pool
Definition: cmsis_os.h:367
xTimerChangePeriod
#define xTimerChangePeriod(xTimer, xNewPeriod, xTicksToWait)
Definition: timers.h:667
uxQueueMessagesWaitingFromISR
PRIVILEGED_FUNCTION UBaseType_t uxQueueMessagesWaitingFromISR(const QueueHandle_t xQueue)
Definition: queue.c:1613
osEvent::def
union osEvent::@55 def
event definition
xSTATIC_TIMER
Definition: FreeRTOS.h:1041
uxSemaphoreGetCount
#define uxSemaphoreGetCount(xSemaphore)
Definition: semphr.h:1167
xTimerDelete
#define xTimerDelete(xTimer, xTicksToWait)
Definition: timers.h:705
os_pool_def
Definition: cmsis_os.h:366
xTaskGetCurrentTaskHandle
PRIVILEGED_FUNCTION TaskHandle_t xTaskGetCurrentTaskHandle(void)
osPoolCreate
osPoolId osPoolCreate(const osPoolDef_t *pool_def)
Create and Initialize a memory pool.
Definition: cmsis_os.c:926
osOK
function completed; no error or event occurred.
Definition: cmsis_os.h:235
portYIELD_FROM_ISR
#define portYIELD_FROM_ISR(x)
Definition: portmacro.h:135
uxTaskPriorityGet
PRIVILEGED_FUNCTION UBaseType_t uxTaskPriorityGet(TaskHandle_t xTask)
void
void
Definition: png.h:1083
portDISABLE_INTERRUPTS
#define portDISABLE_INTERRUPTS()
Definition: portmacro.h:143
osEventMessage
function completed; message event occurred.
Definition: cmsis_os.h:237
vQueueDelete
PRIVILEGED_FUNCTION void vQueueDelete(QueueHandle_t xQueue)
Definition: queue.c:1625
vTaskResume
PRIVILEGED_FUNCTION void vTaskResume(TaskHandle_t xTaskToResume)
xQueueReceiveFromISR
PRIVILEGED_FUNCTION BaseType_t xQueueReceiveFromISR(QueueHandle_t xQueue, void *const pvBuffer, BaseType_t *const pxHigherPriorityTaskWoken)
Definition: queue.c:1434
portNVIC_PENDSVSET_BIT
#define portNVIC_PENDSVSET_BIT
Definition: portmacro.h:133
portBASE_TYPE
#define portBASE_TYPE
Definition: portmacro.h:95
vSemaphoreDelete
#define vSemaphoreDelete(xSemaphore)
Definition: semphr.h:1140
taskSCHEDULER_NOT_STARTED
#define taskSCHEDULER_NOT_STARTED
Definition: task.h:258
osWaitForever
#define osWaitForever
wait forever timeout value
Definition: cmsis_os.h:230
xTaskIncrementTick
PRIVILEGED_FUNCTION BaseType_t xTaskIncrementTick(void)
Definition: tasks.c:2499
taskYIELD
#define taskYIELD()
Definition: task.h:203
os_thread_def::name
char * name
Thread name.
Definition: cmsis_os.h:326
xQueueSendFromISR
#define xQueueSendFromISR(xQueue, pvItemToQueue, pxHigherPriorityTaskWoken)
Definition: queue.h:1361
os_thread_def::pthread
os_pthread pthread
start address of thread function
Definition: cmsis_os.h:327
makeFreeRtosPriority
static unsigned portBASE_TYPE makeFreeRtosPriority(osPriority priority)
Definition: cmsis_os.c:146
TaskFunction_t
void(* TaskFunction_t)(void *)
Definition: projdefs.h:77
portTICK_PERIOD_MS
#define portTICK_PERIOD_MS
Definition: portmacro.h:116
uint8_t
const uint8_t[]
Definition: 404_html.c:3
vTaskPrioritySet
PRIVILEGED_FUNCTION void vTaskPrioritySet(TaskHandle_t xTask, UBaseType_t uxNewPriority)
os_pool_cb::markers
uint8_t * markers
Definition: cmsis_os.c:913
portENABLE_INTERRUPTS
#define portENABLE_INTERRUPTS()
Definition: portmacro.h:144
osMailAlloc
void * osMailAlloc(osMailQId queue_id, uint32_t millisec)
Allocate a memory block from a mail.
Definition: cmsis_os.c:1260
osEventSignal
function completed; signal event occurred.
Definition: cmsis_os.h:236
osEvent::mail_id
osMailQId mail_id
mail id obtained by osMailCreate
Definition: cmsis_os.h:403
uxQueueMessagesWaiting
PRIVILEGED_FUNCTION UBaseType_t uxQueueMessagesWaiting(const QueueHandle_t xQueue)
Definition: queue.c:1579
portEND_SWITCHING_ISR
#define portEND_SWITCHING_ISR(xSwitchRequired)
Definition: portmacro.h:134
osErrorOS
unspecified RTOS error: run-time error but no other error message fits.
Definition: cmsis_os.h:248
os_mailQ_def::cb
struct os_mailQ_cb ** cb
Definition: cmsis_os.h:389
BaseType_t
long BaseType_t
Definition: portmacro.h:98
pdTRUE
#define pdTRUE
Definition: projdefs.h:87
osErrorParameter
parameter error: a mandatory parameter was missing or specified an incorrect object.
Definition: cmsis_os.h:240
osErrorValue
value of a parameter is out of range.
Definition: cmsis_os.h:247
vTaskDelay
PRIVILEGED_FUNCTION void vTaskDelay(const TickType_t xTicksToDelay)
os_pool_def::item_sz
uint32_t item_sz
size of an item
Definition: cmsis_os.h:368
xTaskResumeAll
PRIVILEGED_FUNCTION BaseType_t xTaskResumeAll(void)
Definition: tasks.c:2017
xTimerChangePeriodFromISR
#define xTimerChangePeriodFromISR(xTimer, xNewPeriod, pxHigherPriorityTaskWoken)
Definition: timers.h:1051
xPortSysTickHandler
void xPortSysTickHandler(void)
Definition: port.c:493
vPortFree
PRIVILEGED_FUNCTION void vPortFree(void *pv)
Definition: heap_4.c:305
osEvent::value
union osEvent::@54 value
event value
portCLEAR_INTERRUPT_MASK_FROM_ISR
#define portCLEAR_INTERRUPT_MASK_FROM_ISR(uxSavedStatusValue)
Definition: FreeRTOS.h:304
osTimerPeriodic
repeating timer
Definition: cmsis_os.h:268
os_pool_cb
Definition: cmsis_os.c:911
inHandlerMode
static int inHandlerMode(void)
Definition: cmsis_os.c:173
vPortExitCritical
void vPortExitCritical(void)
Definition: port.c:424
os_mailQ_def::queue_sz
uint32_t queue_sz
number of elements in the queue
Definition: cmsis_os.h:387
portCHAR
#define portCHAR
Definition: portmacro.h:89
os_timer_def::ptimer
os_ptimer ptimer
start address of a timer function
Definition: cmsis_os.h:340
osEvent::v
uint32_t v
message as 32-bit value
Definition: cmsis_os.h:398
portNVIC_INT_CTRL_REG
#define portNVIC_INT_CTRL_REG
Definition: portmacro.h:132
xQueueSend
#define xQueueSend(xQueue, pvItemToQueue, xTicksToWait)
Definition: queue.h:521
vTaskSuspendAll
PRIVILEGED_FUNCTION void vTaskSuspendAll(void)
Definition: tasks.c:1944
os_pool_cb::pool_sz
uint32_t pool_sz
Definition: cmsis_os.c:914
osEvent::message_id
osMessageQId message_id
message id obtained by osMessageCreate
Definition: cmsis_os.h:404
xSemaphoreGive
#define xSemaphoreGive(xSemaphore)
Definition: semphr.h:489
os_messageQ_def::queue_sz
uint32_t queue_sz
number of elements in the queue
Definition: cmsis_os.h:375
os_messageQ_def::item_sz
uint32_t item_sz
size of an item
Definition: cmsis_os.h:376
xQueueReceive
#define xQueueReceive(xQueue, pvBuffer, xTicksToWait)
Definition: queue.h:914
osEvent::p
void * p
message or mail as void pointer
Definition: cmsis_os.h:399
vTaskList
PRIVILEGED_FUNCTION void vTaskList(char *pcWriteBuffer)
vTaskDelayUntil
PRIVILEGED_FUNCTION void vTaskDelayUntil(TickType_t *const pxPreviousWakeTime, const TickType_t xTimeIncrement)
tskIDLE_PRIORITY
#define tskIDLE_PRIORITY
Definition: task.h:193
xQueuePeek
#define xQueuePeek(xQueue, pvBuffer, xTicksToWait)
Definition: queue.h:788
osEvent::signals
int32_t signals
signal flags
Definition: cmsis_os.h:400
uxTaskPriorityGetFromISR
PRIVILEGED_FUNCTION UBaseType_t uxTaskPriorityGetFromISR(TaskHandle_t xTask)
info
uint8_t info[12]
Definition: masstorage.h:54