|
STAR
Cal STAR — firmware, DAQ server, and engine design
|
#include <string.h>#include "FreeRTOS.h"#include "task.h"#include "event_groups.h"#include "semphr.h"#include "timers.h"#include "freertos_mpool.h"#include "freertos_os2.h"#include "cmsis_os2.h"#include "cmsis_compiler.h"Go to the source code of this file.
Classes | |
| struct | TimerCallback_t |
Macros | |
| #define | __ARM_ARCH_6M__ 0 |
| #define | __ARM_ARCH_7M__ 0 |
| #define | __ARM_ARCH_7EM__ 0 |
| #define | __ARM_ARCH_8M_MAIN__ 0 |
| #define | __ARM_ARCH_7A__ 0 |
| #define | IS_IRQ_MASKED() |
| #define | IS_IRQ_MODE() |
| #define | MAX_BITS_TASK_NOTIFY 31U |
| #define | MAX_BITS_EVENT_GROUPS 24U |
| #define | THREAD_FLAGS_INVALID_BITS (~((1UL << MAX_BITS_TASK_NOTIFY) - 1U)) |
| #define | EVENT_FLAGS_INVALID_BITS (~((1UL << MAX_BITS_EVENT_GROUPS) - 1U)) |
| #define | KERNEL_VERSION |
| #define | KERNEL_ID ("FreeRTOS " tskKERNEL_VERSION_NUMBER) |
Functions | |
| static uint32_t | OS_Tick_GetCount (void) |
| static uint32_t | OS_Tick_GetOverflow (void) |
| static uint32_t | OS_Tick_GetInterval (void) |
| __STATIC_INLINE void | SVC_Setup (void) |
| __STATIC_INLINE uint32_t | IRQ_Context (void) |
| osStatus_t | osKernelInitialize (void) |
| Initialize the RTOS Kernel. | |
| osStatus_t | osKernelGetInfo (osVersion_t *version, char *id_buf, uint32_t id_size) |
| Get RTOS Kernel Information. | |
| osKernelState_t | osKernelGetState (void) |
| Get the current RTOS Kernel state. | |
| osStatus_t | osKernelStart (void) |
| Start the RTOS Kernel scheduler. | |
| int32_t | osKernelLock (void) |
| Lock the RTOS Kernel scheduler. | |
| int32_t | osKernelUnlock (void) |
| Unlock the RTOS Kernel scheduler. | |
| int32_t | osKernelRestoreLock (int32_t lock) |
| Restore the RTOS Kernel scheduler lock state. | |
| uint32_t | osKernelGetTickCount (void) |
| Get the RTOS kernel tick count. | |
| uint32_t | osKernelGetTickFreq (void) |
| Get the RTOS kernel tick frequency. | |
| uint32_t | osKernelGetSysTimerCount (void) |
| Get the RTOS kernel system timer count. | |
| uint32_t | osKernelGetSysTimerFreq (void) |
| Get the RTOS kernel system timer frequency. | |
| osThreadId_t | osThreadNew (osThreadFunc_t func, void *argument, const osThreadAttr_t *attr) |
| Create a thread and add it to Active Threads. | |
| const char * | osThreadGetName (osThreadId_t thread_id) |
| Get name of a thread. | |
| osThreadId_t | osThreadGetId (void) |
| Return the thread ID of the current running thread. | |
| osThreadState_t | osThreadGetState (osThreadId_t thread_id) |
| Get current thread state of a thread. | |
| uint32_t | osThreadGetStackSpace (osThreadId_t thread_id) |
| Get available stack space of a thread based on stack watermark recording during execution. | |
| osStatus_t | osThreadSetPriority (osThreadId_t thread_id, osPriority_t priority) |
| Change priority of a thread. | |
| osPriority_t | osThreadGetPriority (osThreadId_t thread_id) |
| Get current priority of a thread. | |
| osStatus_t | osThreadYield (void) |
| Pass control to next thread that is in state READY. | |
| osStatus_t | osThreadSuspend (osThreadId_t thread_id) |
| Suspend execution of a thread. | |
| osStatus_t | osThreadResume (osThreadId_t thread_id) |
| Resume execution of a thread. | |
| __NO_RETURN void | osThreadExit (void) |
| Terminate execution of current running thread. | |
| osStatus_t | osThreadTerminate (osThreadId_t thread_id) |
| Terminate execution of a thread. | |
| uint32_t | osThreadGetCount (void) |
| Get number of active threads. | |
| uint32_t | osThreadEnumerate (osThreadId_t *thread_array, uint32_t array_items) |
| Enumerate active threads. | |
| osStatus_t | osDelay (uint32_t ticks) |
| Wait for Timeout (Time Delay). | |
| osStatus_t | osDelayUntil (uint32_t ticks) |
| Wait until specified time. | |
| osEventFlagsId_t | osEventFlagsNew (const osEventFlagsAttr_t *attr) |
| Create and Initialize an Event Flags object. | |
| uint32_t | osEventFlagsSet (osEventFlagsId_t ef_id, uint32_t flags) |
| Set the specified Event Flags. | |
| uint32_t | osEventFlagsClear (osEventFlagsId_t ef_id, uint32_t flags) |
| Clear the specified Event Flags. | |
| uint32_t | osEventFlagsGet (osEventFlagsId_t ef_id) |
| Get the current Event Flags. | |
| uint32_t | osEventFlagsWait (osEventFlagsId_t ef_id, uint32_t flags, uint32_t options, uint32_t timeout) |
| Wait for one or more Event Flags to become signaled. | |
| osStatus_t | osEventFlagsDelete (osEventFlagsId_t ef_id) |
| Delete an Event Flags object. | |
| osSemaphoreId_t | osSemaphoreNew (uint32_t max_count, uint32_t initial_count, const osSemaphoreAttr_t *attr) |
| Create and Initialize a Semaphore object. | |
| osStatus_t | osSemaphoreAcquire (osSemaphoreId_t semaphore_id, uint32_t timeout) |
| Acquire a Semaphore token or timeout if no tokens are available. | |
| osStatus_t | osSemaphoreRelease (osSemaphoreId_t semaphore_id) |
| Release a Semaphore token up to the initial maximum count. | |
| uint32_t | osSemaphoreGetCount (osSemaphoreId_t semaphore_id) |
| Get current Semaphore token count. | |
| osStatus_t | osSemaphoreDelete (osSemaphoreId_t semaphore_id) |
| Delete a Semaphore object. | |
| osMessageQueueId_t | osMessageQueueNew (uint32_t msg_count, uint32_t msg_size, const osMessageQueueAttr_t *attr) |
| Create and Initialize a Message Queue object. | |
| osStatus_t | osMessageQueuePut (osMessageQueueId_t mq_id, const void *msg_ptr, uint8_t msg_prio, uint32_t timeout) |
| Put a Message into a Queue or timeout if Queue is full. | |
| osStatus_t | osMessageQueueGet (osMessageQueueId_t mq_id, void *msg_ptr, uint8_t *msg_prio, uint32_t timeout) |
| Get a Message from a Queue or timeout if Queue is empty. | |
| uint32_t | osMessageQueueGetCapacity (osMessageQueueId_t mq_id) |
| Get maximum number of messages in a Message Queue. | |
| uint32_t | osMessageQueueGetMsgSize (osMessageQueueId_t mq_id) |
| Get maximum message size in a Message Queue. | |
| uint32_t | osMessageQueueGetCount (osMessageQueueId_t mq_id) |
| Get number of queued messages in a Message Queue. | |
| uint32_t | osMessageQueueGetSpace (osMessageQueueId_t mq_id) |
| Get number of available slots for messages in a Message Queue. | |
| osStatus_t | osMessageQueueReset (osMessageQueueId_t mq_id) |
| Reset a Message Queue to initial empty state. | |
| osStatus_t | osMessageQueueDelete (osMessageQueueId_t mq_id) |
| Delete a Message Queue object. | |
| void | vApplicationIdleHook (void) |
| void | vApplicationMallocFailedHook (void) |
| void | vApplicationDaemonTaskStartupHook (void) |
Variables | |
| static osKernelState_t | KernelState = osKernelInactive |
| #define __ARM_ARCH_6M__ 0 |
Definition at line 38 of file cmsis_os2.c.
| #define __ARM_ARCH_7A__ 0 |
Definition at line 50 of file cmsis_os2.c.
| #define __ARM_ARCH_7EM__ 0 |
Definition at line 44 of file cmsis_os2.c.
| #define __ARM_ARCH_7M__ 0 |
Definition at line 41 of file cmsis_os2.c.
| #define __ARM_ARCH_8M_MAIN__ 0 |
Definition at line 47 of file cmsis_os2.c.
| #define EVENT_FLAGS_INVALID_BITS (~((1UL << MAX_BITS_EVENT_GROUPS) - 1U)) |
Definition at line 83 of file cmsis_os2.c.
Referenced by osEventFlagsClear(), osEventFlagsSet(), and osEventFlagsWait().
| #define IS_IRQ_MASKED | ( | ) |
Definition at line 65 of file cmsis_os2.c.
Referenced by IRQ_Context(), and osKernelGetSysTimerCount().
| #define IS_IRQ_MODE | ( | ) |
| #define KERNEL_ID ("FreeRTOS " tskKERNEL_VERSION_NUMBER) |
Definition at line 90 of file cmsis_os2.c.
Referenced by osKernelGetInfo().
| #define KERNEL_VERSION |
Definition at line 86 of file cmsis_os2.c.
Referenced by osKernelGetInfo().
| #define MAX_BITS_EVENT_GROUPS 24U |
Definition at line 80 of file cmsis_os2.c.
| #define MAX_BITS_TASK_NOTIFY 31U |
Definition at line 79 of file cmsis_os2.c.
| #define THREAD_FLAGS_INVALID_BITS (~((1UL << MAX_BITS_TASK_NOTIFY) - 1U)) |
Definition at line 82 of file cmsis_os2.c.
| __STATIC_INLINE uint32_t IRQ_Context | ( | void | ) |
Definition at line 200 of file cmsis_os2.c.
References __STATIC_INLINE, IS_IRQ_MASKED, IS_IRQ_MODE, state, taskSCHEDULER_NOT_STARTED, and xTaskGetSchedulerState().
Referenced by osDelay(), osDelayUntil(), osEventFlagsClear(), osEventFlagsDelete(), osEventFlagsGet(), osEventFlagsNew(), osEventFlagsSet(), osEventFlagsWait(), osKernelGetTickCount(), osKernelInitialize(), osKernelLock(), osKernelRestoreLock(), osKernelStart(), osKernelUnlock(), osMessageQueueDelete(), osMessageQueueGet(), osMessageQueueGetCount(), osMessageQueueGetSpace(), osMessageQueueNew(), osMessageQueuePut(), osMessageQueueReset(), osSemaphoreAcquire(), osSemaphoreDelete(), osSemaphoreGetCount(), osSemaphoreNew(), osSemaphoreRelease(), osThreadEnumerate(), osThreadGetCount(), osThreadGetName(), osThreadGetPriority(), osThreadGetStackSpace(), osThreadGetState(), osThreadNew(), osThreadResume(), osThreadSetPriority(), osThreadSuspend(), osThreadTerminate(), and osThreadYield().
|
static |
Definition at line 228 of file cmsis_os2.c.
Referenced by osKernelGetSysTimerCount().
|
static |
Definition at line 251 of file cmsis_os2.c.
Referenced by osKernelGetSysTimerCount().
|
static |
Definition at line 239 of file cmsis_os2.c.
Referenced by osKernelGetSysTimerCount().
| osStatus_t osDelay | ( | uint32_t | ticks | ) |
Wait for Timeout (Time Delay).
| [in] | ticks | time ticks value |
Definition at line 1094 of file cmsis_os2.c.
References IRQ_Context(), osErrorISR, osOK, and vTaskDelay().
Referenced by board_bringup_power_up(), bringup_task(), anonymous_namespace{radio_task.cpp}::BoardControl::delay_ms(), delay_ms(), emmc_stm32_writer_task(), gps_power(), ms5611_reset(), port_start(), sd_nand_probe(), StartDefaultTask(), wait_since_boot(), and wait_transfer_state().
| osStatus_t osDelayUntil | ( | uint32_t | ticks | ) |
Wait until specified time.
| [in] | ticks | absolute time in ticks |
Definition at line 1115 of file cmsis_os2.c.
References delay(), IRQ_Context(), osError, osErrorISR, osErrorParameter, osOK, pdFALSE, xTaskDelayUntil(), and xTaskGetTickCount().
| uint32_t osEventFlagsClear | ( | osEventFlagsId_t | ef_id, |
| uint32_t | flags ) |
Clear the specified Event Flags.
| [in] | ef_id | event flags ID obtained by osEventFlagsNew. |
| [in] | flags | specifies the flags that shall be cleared. |
Definition at line 1505 of file cmsis_os2.c.
References EVENT_FLAGS_INVALID_BITS, IRQ_Context(), NULL, osErrorParameter, osErrorResource, pdFAIL, pdTRUE, portYIELD_FROM_ISR, xEventGroupClearBits(), xEventGroupClearBitsFromISR, and xEventGroupGetBitsFromISR().
| osStatus_t osEventFlagsDelete | ( | osEventFlagsId_t | ef_id | ) |
Delete an Event Flags object.
| [in] | ef_id | event flags ID obtained by osEventFlagsNew. |
Definition at line 1629 of file cmsis_os2.c.
References IRQ_Context(), NULL, osError, osErrorISR, osErrorParameter, osOK, and vEventGroupDelete().
| uint32_t osEventFlagsGet | ( | osEventFlagsId_t | ef_id | ) |
Get the current Event Flags.
| [in] | ef_id | event flags ID obtained by osEventFlagsNew. |
Definition at line 1544 of file cmsis_os2.c.
References IRQ_Context(), NULL, xEventGroupGetBits, and xEventGroupGetBitsFromISR().
| osEventFlagsId_t osEventFlagsNew | ( | const osEventFlagsAttr_t * | attr | ) |
Create and Initialize an Event Flags object.
| [in] | attr | event flags attributes; NULL: default values. |
Definition at line 1416 of file cmsis_os2.c.
References osEventFlagsAttr_t::cb_mem, osEventFlagsAttr_t::cb_size, IRQ_Context(), and NULL.
| uint32_t osEventFlagsSet | ( | osEventFlagsId_t | ef_id, |
| uint32_t | flags ) |
Set the specified Event Flags.
| [in] | ef_id | event flags ID obtained by osEventFlagsNew. |
| [in] | flags | specifies the flags that shall be set. |
Definition at line 1465 of file cmsis_os2.c.
References EVENT_FLAGS_INVALID_BITS, IRQ_Context(), NULL, osErrorParameter, osErrorResource, pdFAIL, pdFALSE, portYIELD_FROM_ISR, xEventGroupGetBitsFromISR(), xEventGroupSetBits(), and xEventGroupSetBitsFromISR.
| uint32_t osEventFlagsWait | ( | osEventFlagsId_t | ef_id, |
| uint32_t | flags, | ||
| uint32_t | options, | ||
| uint32_t | timeout ) |
Wait for one or more Event Flags to become signaled.
| [in] | ef_id | event flags ID obtained by osEventFlagsNew. |
| [in] | flags | specifies the flags to wait for. |
| [in] | options | specifies flags options (osFlagsXxxx). |
| [in] | timeout | CMSIS_RTOS_TimeOutValue or 0 in case of no time-out. |
Definition at line 1569 of file cmsis_os2.c.
References EVENT_FLAGS_INVALID_BITS, IRQ_Context(), NULL, osErrorISR, osErrorParameter, osErrorResource, osErrorTimeout, osFlagsErrorParameter, osFlagsNoClear, osFlagsWaitAll, pdFAIL, pdTRUE, and xEventGroupWaitBits().
| osStatus_t osKernelGetInfo | ( | osVersion_t * | version, |
| char * | id_buf, | ||
| uint32_t | id_size ) |
Get RTOS Kernel Information.
| [out] | version | pointer to buffer for retrieving version information. |
| [out] | id_buf | pointer to buffer for retrieving kernel identification string. |
| [in] | id_size | size of buffer for kernel identification string. |
Definition at line 298 of file cmsis_os2.c.
References osVersion_t::api, osVersion_t::kernel, KERNEL_ID, KERNEL_VERSION, NULL, and osOK.
| osKernelState_t osKernelGetState | ( | void | ) |
Get the current RTOS Kernel state.
Definition at line 322 of file cmsis_os2.c.
References KernelState, osKernelInactive, osKernelLocked, osKernelReady, osKernelRunning, state, taskSCHEDULER_NOT_STARTED, taskSCHEDULER_RUNNING, taskSCHEDULER_SUSPENDED, and xTaskGetSchedulerState().
| uint32_t osKernelGetSysTimerCount | ( | void | ) |
Get the RTOS kernel system timer count.
Definition at line 515 of file cmsis_os2.c.
References __disable_irq, __enable_irq, IS_IRQ_MASKED, OS_Tick_GetCount(), OS_Tick_GetInterval(), OS_Tick_GetOverflow(), and xTaskGetTickCount().
| uint32_t osKernelGetSysTimerFreq | ( | void | ) |
Get the RTOS kernel system timer frequency.
Definition at line 561 of file cmsis_os2.c.
References configCPU_CLOCK_HZ.
| uint32_t osKernelGetTickCount | ( | void | ) |
Get the RTOS kernel tick count.
Definition at line 491 of file cmsis_os2.c.
References IRQ_Context(), xTaskGetTickCount(), and xTaskGetTickCountFromISR().
Referenced by app_set_state(), emmc_stm32_writer_task(), finish(), idle_task(), to_emmc(), to_emmc(), and wait_transfer_state().
| uint32_t osKernelGetTickFreq | ( | void | ) |
Get the RTOS kernel tick frequency.
Definition at line 507 of file cmsis_os2.c.
References configTICK_RATE_HZ.
| osStatus_t osKernelInitialize | ( | void | ) |
Initialize the RTOS Kernel.
Definition at line 264 of file cmsis_os2.c.
References IRQ_Context(), KernelState, osError, osErrorISR, osKernelInactive, osKernelReady, osOK, state, taskSCHEDULER_NOT_STARTED, vPortDefineHeapRegions(), and xTaskGetSchedulerState().
Referenced by main().
| int32_t osKernelLock | ( | void | ) |
Lock the RTOS Kernel scheduler.
Definition at line 384 of file cmsis_os2.c.
References IRQ_Context(), lock, osError, osErrorISR, taskSCHEDULER_NOT_STARTED, taskSCHEDULER_RUNNING, taskSCHEDULER_SUSPENDED, vTaskSuspendAll(), and xTaskGetSchedulerState().
| int32_t osKernelRestoreLock | ( | int32_t | lock | ) |
Restore the RTOS Kernel scheduler lock state.
| [in] | lock | lock state obtained by osKernelLock or osKernelUnlock. |
Definition at line 451 of file cmsis_os2.c.
References IRQ_Context(), lock, osError, osErrorISR, pdTRUE, taskSCHEDULER_NOT_STARTED, taskSCHEDULER_RUNNING, taskSCHEDULER_SUSPENDED, vTaskSuspendAll(), xTaskGetSchedulerState(), and xTaskResumeAll().
| osStatus_t osKernelStart | ( | void | ) |
Start the RTOS Kernel scheduler.
Definition at line 353 of file cmsis_os2.c.
References IRQ_Context(), KernelState, osError, osErrorISR, osKernelReady, osKernelRunning, osOK, state, SVC_Setup(), taskSCHEDULER_NOT_STARTED, vTaskStartScheduler(), and xTaskGetSchedulerState().
Referenced by main().
| int32_t osKernelUnlock | ( | void | ) |
Unlock the RTOS Kernel scheduler.
Definition at line 415 of file cmsis_os2.c.
References IRQ_Context(), lock, osError, osErrorISR, pdTRUE, taskSCHEDULER_NOT_STARTED, taskSCHEDULER_RUNNING, taskSCHEDULER_SUSPENDED, xTaskGetSchedulerState(), and xTaskResumeAll().
| osStatus_t osMessageQueueDelete | ( | osMessageQueueId_t | mq_id | ) |
Delete a Message Queue object.
| [in] | mq_id | message queue ID obtained by osMessageQueueNew. |
Definition at line 2360 of file cmsis_os2.c.
References IRQ_Context(), NULL, osError, osErrorISR, osErrorParameter, osOK, vQueueDelete(), and vQueueUnregisterQueue.
| osStatus_t osMessageQueueGet | ( | osMessageQueueId_t | mq_id, |
| void * | msg_ptr, | ||
| uint8_t * | msg_prio, | ||
| uint32_t | timeout ) |
Get a Message from a Queue or timeout if Queue is empty.
| [in] | mq_id | message queue ID obtained by osMessageQueueNew. |
| [out] | msg_ptr | pointer to buffer for message to get from a queue. |
| [out] | msg_prio | pointer to buffer for message priority or NULL. |
| [in] | timeout | CMSIS_RTOS_TimeOutValue or 0 in case of no time-out. |
Definition at line 2209 of file cmsis_os2.c.
References IRQ_Context(), NULL, osErrorParameter, osErrorResource, osErrorTimeout, osOK, pdFALSE, pdPASS, portYIELD_FROM_ISR, xQueueReceive(), and xQueueReceiveFromISR().
Referenced by poll_command().
| uint32_t osMessageQueueGetCapacity | ( | osMessageQueueId_t | mq_id | ) |
Get maximum number of messages in a Message Queue.
| [in] | mq_id | message queue ID obtained by osMessageQueueNew. |
Definition at line 2254 of file cmsis_os2.c.
References NULL, and xSTATIC_QUEUE::uxDummy4.
| uint32_t osMessageQueueGetCount | ( | osMessageQueueId_t | mq_id | ) |
Get number of queued messages in a Message Queue.
| [in] | mq_id | message queue ID obtained by osMessageQueueNew. |
Definition at line 2290 of file cmsis_os2.c.
References count(), IRQ_Context(), NULL, uxQueueMessagesWaiting(), and uxQueueMessagesWaitingFromISR().
Referenced by work_waiting().
| uint32_t osMessageQueueGetMsgSize | ( | osMessageQueueId_t | mq_id | ) |
Get maximum message size in a Message Queue.
| [in] | mq_id | message queue ID obtained by osMessageQueueNew. |
Definition at line 2272 of file cmsis_os2.c.
References NULL, and xSTATIC_QUEUE::uxDummy4.
| uint32_t osMessageQueueGetSpace | ( | osMessageQueueId_t | mq_id | ) |
Get number of available slots for messages in a Message Queue.
| [in] | mq_id | message queue ID obtained by osMessageQueueNew. |
Definition at line 2311 of file cmsis_os2.c.
References IRQ_Context(), NULL, taskENTER_CRITICAL_FROM_ISR, taskEXIT_CRITICAL_FROM_ISR, xSTATIC_QUEUE::uxDummy4, and uxQueueSpacesAvailable().
| osMessageQueueId_t osMessageQueueNew | ( | uint32_t | msg_count, |
| uint32_t | msg_size, | ||
| const osMessageQueueAttr_t * | attr ) |
Create and Initialize a Message Queue object.
| [in] | msg_count | maximum number of messages in queue. |
| [in] | msg_size | maximum message size in bytes. |
| [in] | attr | message queue attributes; NULL: default values. |
Definition at line 2100 of file cmsis_os2.c.
References osMessageQueueAttr_t::cb_mem, osMessageQueueAttr_t::cb_size, IRQ_Context(), osMessageQueueAttr_t::mq_mem, osMessageQueueAttr_t::mq_size, osMessageQueueAttr_t::name, NULL, and vQueueAddToRegistry.
Referenced by idle_task_start().
| osStatus_t osMessageQueuePut | ( | osMessageQueueId_t | mq_id, |
| const void * | msg_ptr, | ||
| uint8_t | msg_prio, | ||
| uint32_t | timeout ) |
Put a Message into a Queue or timeout if Queue is full.
| [in] | mq_id | message queue ID obtained by osMessageQueueNew. |
| [in] | msg_ptr | pointer to buffer with message to put into a queue. |
| [in] | msg_prio | message priority. |
| [in] | timeout | CMSIS_RTOS_TimeOutValue or 0 in case of no time-out. |
Definition at line 2161 of file cmsis_os2.c.
References IRQ_Context(), NULL, osErrorParameter, osErrorResource, osErrorTimeout, osOK, pdFALSE, pdPASS, pdTRUE, portYIELD_FROM_ISR, xQueueSendToBack, and xQueueSendToBackFromISR.
Referenced by idle_task_command().
| osStatus_t osMessageQueueReset | ( | osMessageQueueId_t | mq_id | ) |
Reset a Message Queue to initial empty state.
| [in] | mq_id | message queue ID obtained by osMessageQueueNew. |
Definition at line 2338 of file cmsis_os2.c.
References IRQ_Context(), NULL, osErrorISR, osErrorParameter, osOK, and xQueueReset.
| osStatus_t osSemaphoreAcquire | ( | osSemaphoreId_t | semaphore_id, |
| uint32_t | timeout ) |
Acquire a Semaphore token or timeout if no tokens are available.
| [in] | semaphore_id | semaphore ID obtained by osSemaphoreNew. |
| [in] | timeout | CMSIS_RTOS_TimeOutValue or 0 in case of no time-out. |
Definition at line 1970 of file cmsis_os2.c.
References IRQ_Context(), NULL, osErrorParameter, osErrorResource, osErrorTimeout, osOK, pdFALSE, pdPASS, portYIELD_FROM_ISR, xSemaphoreTake, and xSemaphoreTakeFromISR.
Referenced by finish(), port_read(), and port_write().
| osStatus_t osSemaphoreDelete | ( | osSemaphoreId_t | semaphore_id | ) |
Delete a Semaphore object.
| [in] | semaphore_id | semaphore ID obtained by osSemaphoreNew. |
Definition at line 2063 of file cmsis_os2.c.
References IRQ_Context(), NULL, osError, osErrorISR, osErrorParameter, osOK, vQueueUnregisterQueue, and vSemaphoreDelete.
| uint32_t osSemaphoreGetCount | ( | osSemaphoreId_t | semaphore_id | ) |
Get current Semaphore token count.
| [in] | semaphore_id | semaphore ID obtained by osSemaphoreNew. |
Definition at line 2043 of file cmsis_os2.c.
References count(), IRQ_Context(), NULL, uxSemaphoreGetCount, and uxSemaphoreGetCountFromISR.
| osSemaphoreId_t osSemaphoreNew | ( | uint32_t | max_count, |
| uint32_t | initial_count, | ||
| const osSemaphoreAttr_t * | attr ) |
Create and Initialize a Semaphore object.
| [in] | max_count | maximum number of available tokens. |
| [in] | initial_count | initial number of available tokens. |
| [in] | attr | semaphore attributes; NULL: default values. |
Definition at line 1894 of file cmsis_os2.c.
References osSemaphoreAttr_t::cb_mem, osSemaphoreAttr_t::cb_size, IRQ_Context(), osSemaphoreAttr_t::name, NULL, pdPASS, vQueueAddToRegistry, vSemaphoreDelete, and xSemaphoreGive.
Referenced by emmc_stm32_init().
| osStatus_t osSemaphoreRelease | ( | osSemaphoreId_t | semaphore_id | ) |
Release a Semaphore token up to the initial maximum count.
| [in] | semaphore_id | semaphore ID obtained by osSemaphoreNew. |
Definition at line 2011 of file cmsis_os2.c.
References IRQ_Context(), NULL, osErrorParameter, osErrorResource, osOK, pdFALSE, pdPASS, pdTRUE, portYIELD_FROM_ISR, xSemaphoreGive, and xSemaphoreGiveFromISR.
Referenced by HAL_MMC_ErrorCallback(), and HAL_MMC_TxCpltCallback().
| uint32_t osThreadEnumerate | ( | osThreadId_t * | thread_array, |
| uint32_t | array_items ) |
Enumerate active threads.
| [out] | thread_array | pointer to array for retrieving thread IDs. |
| [in] | array_items | maximum number of items in array for retrieving thread IDs. |
Definition at line 886 of file cmsis_os2.c.
References count(), IRQ_Context(), NULL, pvPortMalloc(), uxTaskGetNumberOfTasks(), uxTaskGetSystemState(), vPortFree(), vTaskSuspendAll(), and xTaskResumeAll().
| __NO_RETURN void osThreadExit | ( | void | ) |
Terminate execution of current running thread.
Definition at line 826 of file cmsis_os2.c.
References __NO_RETURN, NULL, and vTaskDelete().
| uint32_t osThreadGetCount | ( | void | ) |
Get number of active threads.
Definition at line 869 of file cmsis_os2.c.
References count(), IRQ_Context(), and uxTaskGetNumberOfTasks().
| osThreadId_t osThreadGetId | ( | void | ) |
Return the thread ID of the current running thread.
Definition at line 669 of file cmsis_os2.c.
References xTaskGetCurrentTaskHandle().
Referenced by gnss_task(), anonymous_namespace{radio_task.cpp}::radio_task(), and sensors_task().
| const char * osThreadGetName | ( | osThreadId_t | thread_id | ) |
Get name of a thread.
| [in] | thread_id | thread ID obtained by osThreadNew or osThreadGetId. |
Definition at line 652 of file cmsis_os2.c.
References IRQ_Context(), NULL, and pcTaskGetName().
| osPriority_t osThreadGetPriority | ( | osThreadId_t | thread_id | ) |
Get current priority of a thread.
| [in] | thread_id | thread ID obtained by osThreadNew or osThreadGetId. |
Definition at line 746 of file cmsis_os2.c.
References IRQ_Context(), NULL, osPriorityError, and uxTaskPriorityGet().
| uint32_t osThreadGetStackSpace | ( | osThreadId_t | thread_id | ) |
Get available stack space of a thread based on stack watermark recording during execution.
| [in] | thread_id | thread ID obtained by osThreadNew or osThreadGetId. |
Definition at line 707 of file cmsis_os2.c.
References IRQ_Context(), NULL, and uxTaskGetStackHighWaterMark().
| osThreadState_t osThreadGetState | ( | osThreadId_t | thread_id | ) |
Get current thread state of a thread.
| [in] | thread_id | thread ID obtained by osThreadNew or osThreadGetId. |
Definition at line 681 of file cmsis_os2.c.
References eBlocked, eDeleted, eInvalid, eReady, eRunning, eSuspended, eTaskGetState(), IRQ_Context(), NULL, osThreadBlocked, osThreadError, osThreadReady, osThreadRunning, and state.
| osThreadId_t osThreadNew | ( | osThreadFunc_t | func, |
| void * | argument, | ||
| const osThreadAttr_t * | attr ) |
Create a thread and add it to Active Threads.
| [in] | func | thread function. |
| [in] | argument | pointer that is passed to the thread function as start argument. |
| [in] | attr | thread attributes; NULL: default values. |
Definition at line 577 of file cmsis_os2.c.
References osThreadAttr_t::attr_bits, osThreadAttr_t::cb_mem, osThreadAttr_t::cb_size, configMINIMAL_STACK_SIZE, configSTACK_DEPTH_TYPE, IRQ_Context(), osThreadAttr_t::name, NULL, osPriorityIdle, osPriorityISR, osPriorityNone, osPriorityNormal, osThreadJoinable, pdPASS, osThreadAttr_t::priority, osThreadAttr_t::stack_mem, and osThreadAttr_t::stack_size.
Referenced by bringup_task_start(), gnss_task_start(), idle_task_start(), main(), radio_task_start(), sensors_task_start(), and start_emmc().
| osStatus_t osThreadResume | ( | osThreadId_t | thread_id | ) |
Resume execution of a thread.
| [in] | thread_id | thread ID obtained by osThreadNew or osThreadGetId. |
Definition at line 803 of file cmsis_os2.c.
References IRQ_Context(), NULL, osErrorISR, osErrorParameter, osOK, and vTaskResume().
| osStatus_t osThreadSetPriority | ( | osThreadId_t | thread_id, |
| osPriority_t | priority ) |
Change priority of a thread.
| [in] | thread_id | thread ID obtained by osThreadNew or osThreadGetId. |
| [in] | priority | new priority value for the thread function. |
Definition at line 724 of file cmsis_os2.c.
References IRQ_Context(), NULL, osErrorISR, osErrorParameter, osOK, osPriorityIdle, osPriorityISR, and vTaskPrioritySet().
| osStatus_t osThreadSuspend | ( | osThreadId_t | thread_id | ) |
Suspend execution of a thread.
| [in] | thread_id | thread ID obtained by osThreadNew or osThreadGetId. |
Definition at line 781 of file cmsis_os2.c.
References IRQ_Context(), NULL, osErrorISR, osErrorParameter, osOK, and vTaskSuspend().
| osStatus_t osThreadTerminate | ( | osThreadId_t | thread_id | ) |
Terminate execution of a thread.
| [in] | thread_id | thread ID obtained by osThreadNew or osThreadGetId. |
Definition at line 836 of file cmsis_os2.c.
References eDeleted, eTaskGetState(), IRQ_Context(), NULL, osError, osErrorISR, osErrorParameter, osErrorResource, osOK, and vTaskDelete().
| osStatus_t osThreadYield | ( | void | ) |
Pass control to next thread that is in state READY.
Definition at line 763 of file cmsis_os2.c.
References IRQ_Context(), osErrorISR, osOK, and taskYIELD.
| __STATIC_INLINE void SVC_Setup | ( | void | ) |
Definition at line 181 of file cmsis_os2.c.
References __STATIC_INLINE, NVIC_SetPriority, and SVCall_IRQn.
Referenced by osKernelStart().
|
extern |
References __WEAK.
|
extern |
Referenced by portTASK_FUNCTION().
|
extern |
Definition at line 69 of file freertos.c.
Referenced by prvHeapInit().
|
static |
Definition at line 99 of file cmsis_os2.c.
Referenced by osKernelGetState(), osKernelInitialize(), and osKernelStart().