![]() |
SuperTinyKernel™ RTOS 1.06.x
Lightweight, high-performance, deterministic, bare-metal C++ RTOS for resource-constrained embedded systems. MIT Open Source License.
|
FreeRTOS interface for C++ API of SuperTinyKernel RTOS. More...
Classes | |
| struct | TaskParameters_t |
| Parameters passed to xTaskCreate(). More... | |
| struct | TaskStatus_t |
| struct | StaticTask_t |
| struct | StaticQueue_t |
| struct | StaticSemaphore_t |
| struct | StaticTimer_t |
| struct | StaticEventGroup_t |
| struct | StaticStreamBuffer_t |
| struct | StaticMessageBuffer_t |
| struct | MemoryRegion_t |
| struct | TaskParameters_restricted_t |
| struct | HeapStats_t |
Typedefs | |
| typedef uint32_t | TickType_t |
| typedef long | BaseType_t |
| typedef unsigned long | UBaseType_t |
| typedef long | portBASE_TYPE |
| typedef uintptr_t | StackType_t |
| typedef void * | TaskHandle_t |
| typedef void * | QueueHandle_t |
| typedef void * | SemaphoreHandle_t |
| typedef void * | TimerHandle_t |
| typedef void * | EventGroupHandle_t |
| typedef void * | StreamBufferHandle_t |
| typedef void * | MessageBufferHandle_t |
| typedef void * | QueueSetHandle_t |
| typedef void * | QueueSetMemberHandle_t |
| typedef void(* | TaskFunction_t) (void *pvParameters) |
| typedef void(* | TimerCallbackFunction_t) (TimerHandle_t xTimer) |
| typedef void(* | PendedFunction_t) (void *pvParameter1, uint32_t ulParameter2) |
| typedef void(* | StreamBufferCallbackFunction_t) (StreamBufferHandle_t xStreamBuffer, BaseType_t *pxHigherPriorityTaskWoken) |
| typedef uint32_t | EventBits_t |
Enumerations | |
| enum | eTaskState { eRunning = 0 , eReady , eBlocked , eSuspended , eDeleted , eInvalid } |
| Task execution state, returned by eTaskGetState(). More... | |
| enum | eNotifyAction { eNoAction = 0 , eSetBits , eIncrement , eSetValueWithOverwrite , eSetValueWithoutOverwrite } |
| Action applied to a task's notification value by xTaskNotify(). More... | |
FreeRTOS interface for C++ API of SuperTinyKernel RTOS.
Maps standard FreeRTOS C API onto the STK C++ API, allowing existing FreeRTOS-based projects to run on STK with minimal or no application changes.
Supported API groups:
Design notes:
Limitations / deviations:
| #define configMAX_PRIORITIES 32U |
Definition at line 152 of file FreeRTOS.h.
Referenced by FrtosPrioToStkWeight(), and StkWeightToFrtosPrio().
| #define configMINIMAL_STACK_SIZE 128U |
Minimum stack depth in Words.
Definition at line 156 of file FreeRTOS.h.
| #define configNUM_THREAD_LOCAL_STORAGE_POINTERS 4U |
Per-task TLS pointer slots.
Definition at line 164 of file FreeRTOS.h.
Referenced by FrtosTask::FrtosTask(), pvTaskGetThreadLocalStoragePointer(), and vTaskSetThreadLocalStoragePointer().
| #define configSTACK_DEPTH_TYPE StackType_t |
Stack depth word type.
Definition at line 271 of file FreeRTOS.h.
Referenced by uxTaskGetStackHighWaterMark2(), and uxTaskGetSystemState().
| #define configTASK_NOTIFICATION_ARRAY_ENTRIES 1U |
Number of per-task notification slots (indexed API).
Definition at line 168 of file FreeRTOS.h.
Referenced by ResolveNotifyTarget().
| #define configTICK_RATE_HZ 1000U |
Definition at line 160 of file FreeRTOS.h.
| #define configTOTAL_HEAP_SIZE 10240U |
Dynamic heap size in bytes.
Definition at line 200 of file FreeRTOS.h.
| #define configUSE_COUNTING_SEMAPHORES 1U |
Include counting semaphore API.
Definition at line 192 of file FreeRTOS.h.
| #define configUSE_EVENT_GROUPS 1U |
Include event group API.
Definition at line 184 of file FreeRTOS.h.
| #define configUSE_MUTEXES 1U |
Include mutex and recursive-mutex API.
Definition at line 176 of file FreeRTOS.h.
Referenced by FrtosSemaphore::FrtosSemaphore().
| #define configUSE_QUEUE_SETS 1U |
Include queue sets API.
Definition at line 172 of file FreeRTOS.h.
Referenced by FrtosQueue::FrtosQueue(), FrtosQueue::FrtosQueue(), and FrtosSemaphore::FrtosSemaphore().
| #define configUSE_STREAM_BUFFERS 1U |
Include stream buffer and message buffer API.
Definition at line 188 of file FreeRTOS.h.
| #define configUSE_TASK_NOTIFICATIONS 1U |
Include task notification API (xTaskNotify etc.).
Definition at line 196 of file FreeRTOS.h.
| #define configUSE_TIMERS 1U |
Include software timer API.
Definition at line 180 of file FreeRTOS.h.
| #define errQUEUE_EMPTY ((BaseType_t)0) |
Definition at line 267 of file FreeRTOS.h.
| #define errQUEUE_FULL ((BaseType_t)0) |
Definition at line 268 of file FreeRTOS.h.
| #define FREERTOS_STK_DEFAULT_STACK_WORDS 256U |
Default stack depth in Words when the caller passes usStackDepth = 0.
Definition at line 215 of file FreeRTOS.h.
Referenced by xTaskCreate().
| #define FREERTOS_STK_MAX_TASKS 16U |
Maximum number of concurrent tasks managed by the kernel. Increase if your application creates more tasks simultaneously.
Definition at line 208 of file FreeRTOS.h.
Referenced by uxTaskGetSystemState(), vTaskEndScheduler(), vTaskGetRunTimeStats(), vTaskList(), and xTaskGetHandle().
| #define FREERTOS_STK_PEND_CALL_QUEUE_SIZE 8U |
Capacity of the static deferred-call queue used by xTimerPendFunctionCall() and xTimerPendFunctionCallFromISR().
Each slot holds one PendCall record: one function pointer, one void* parameter, and one uint32_t parameter — typically 12–16 bytes on 32-bit targets. The queue lives in static storage (zero heap), so this value determines RAM consumption at link time rather than runtime.
Choose the maximum number of deferred calls that can be simultaneously in-flight before the TimerHost handler task drains them. A value of 8 is sufficient for most applications; increase it if your ISR rate is high relative to the RTOS tick rate or if several ISRs may pend calls concurrently.
Definition at line 238 of file FreeRTOS.h.
| #define pdFAIL (pdFALSE) |
Definition at line 266 of file FreeRTOS.h.
Referenced by NotifyApplyAction(), xEventGroupSetBitsFromISR(), xMessageBufferReset(), xMessageBufferResetFromISR(), xQueueAddToSet(), xQueueOverwrite(), xQueueOverwriteFromISR(), xQueuePeek(), xQueuePeekFromISR(), xQueueReceive(), xQueueReceiveFromISR(), xQueueRemoveFromSet(), xQueueReset(), xQueueSend(), xQueueSendFromISR(), xQueueSendToFront(), xQueueSendToFrontFromISR(), xSemaphoreGive(), xSemaphoreGiveFromISR(), xSemaphoreTake(), xSemaphoreTakeFromISR(), xStreamBufferReset(), xStreamBufferResetFromISR(), xTaskAbortDelay(), xTaskCreate(), xTaskCreateRestricted(), xTaskCreateRestrictedStatic(), xTaskNotifyAndQueryIndexed(), xTaskNotifyGiveIndexed(), xTaskNotifyIndexed(), xTaskNotifyWaitIndexed(), xTimerChangePeriod(), xTimerChangePeriodFromISR(), xTimerDelete(), xTimerPendFunctionCall(), xTimerPendFunctionCallFromISR(), xTimerStart(), xTimerStartFromISR(), xTimerStop(), and xTimerStopFromISR().
| #define pdFALSE ((BaseType_t)0) |
Definition at line 264 of file FreeRTOS.h.
Referenced by BuildStkFlagsOpts(), xEventGroupSetBitsFromISR(), xMessageBufferIsEmpty(), xMessageBufferIsFull(), xMessageBufferReceive(), xMessageBufferReceiveFromISR(), xMessageBufferResetFromISR(), xMessageBufferSend(), xMessageBufferSendFromISR(), xQueueIsQueueEmptyFromISR(), xQueueIsQueueFullFromISR(), xQueueOverwriteFromISR(), xQueueReceiveFromISR(), xQueueSendFromISR(), xQueueSendToFrontFromISR(), xSemaphoreGiveFromISR(), xSemaphoreTakeFromISR(), xStreamBufferIsEmpty(), xStreamBufferIsFull(), xStreamBufferReceive(), xStreamBufferReceiveFromISR(), xStreamBufferResetFromISR(), xStreamBufferSend(), xStreamBufferSendFromISR(), xStreamBufferSetTriggerLevel(), xTaskAbortDelay(), xTaskDelayUntil(), xTaskNotifyAndQueryFromISRIndexed(), xTaskNotifyFromISRIndexed(), xTaskNotifyStateClearIndexed(), xTaskResumeAll(), xTaskResumeFromISR(), xTimerChangePeriodFromISR(), xTimerIsTimerActive(), xTimerPendFunctionCallFromISR(), xTimerStartFromISR(), and xTimerStopFromISR().
| #define pdMS_TO_TICKS | ( | xTimeInMs | ) |
| #define pdPASS (pdTRUE) |
Definition at line 265 of file FreeRTOS.h.
Referenced by NotifyApplyAction(), xEventGroupSetBitsFromISR(), xMessageBufferReset(), xMessageBufferResetFromISR(), xQueueAddToSet(), xQueueOverwrite(), xQueueOverwriteFromISR(), xQueuePeek(), xQueuePeekFromISR(), xQueueReceive(), xQueueReceiveFromISR(), xQueueRemoveFromSet(), xQueueReset(), xQueueSend(), xQueueSendFromISR(), xQueueSendToFront(), xQueueSendToFrontFromISR(), xSemaphoreGive(), xSemaphoreGiveFromISR(), xSemaphoreTake(), xSemaphoreTakeFromISR(), xStreamBufferReset(), xStreamBufferResetFromISR(), xTaskAbortDelay(), xTaskCreate(), xTaskCreateRestrictedStatic(), xTaskNotifyAndQueryIndexed(), xTaskNotifyGiveIndexed(), xTaskNotifyIndexed(), xTaskNotifyWaitIndexed(), xTimerChangePeriodFromISR(), xTimerDelete(), xTimerPendFunctionCall(), xTimerPendFunctionCallFromISR(), xTimerStart(), xTimerStartFromISR(), xTimerStop(), and xTimerStopFromISR().
| #define pdTRUE ((BaseType_t)1) |
Definition at line 263 of file FreeRTOS.h.
Referenced by BuildStkFlagsOpts(), ulTaskNotifyTakeIndexed(), xMessageBufferIsEmpty(), xMessageBufferIsFull(), xQueueIsQueueEmptyFromISR(), xQueueIsQueueFullFromISR(), xStreamBufferIsEmpty(), xStreamBufferIsFull(), xStreamBufferSetTriggerLevel(), xTaskDelayUntil(), xTaskNotifyStateClearIndexed(), xTaskResumeFromISR(), xTimerCreate(), xTimerCreateStatic(), and xTimerIsTimerActive().
| #define portMAX_DELAY ((TickType_t)0xFFFFFFFFUL) |
| #define portNUM_CONFIGURABLE_REGIONS 3U |
MPU memory region descriptor used by xTaskCreateRestrictedStatic().
Definition at line 570 of file FreeRTOS.h.
| #define portYIELD | ( | ) |
Definition at line 408 of file FreeRTOS.h.
| #define STATIC_EVENT_GROUP_TCB_SIZE_WORDS 10U |
Opaque buffer type that the caller must supply for xEventGroupCreateStatic(). Must be at least sizeof(FrtosEventGroup) bytes. Declared as a fixed-size array of uintptr_t to enforce natural alignment without exposing FrtosEventGroup internals.
Definition at line 518 of file FreeRTOS.h.
| #define STATIC_MESSAGE_BUFFER_TCB_SIZE_WORDS 38U |
Opaque buffer type for xMessageBufferCreateStatic() and xMessageBufferCreateStaticWithCallback(). Covers FrtosMessageBuffer (BlockMemoryPool header + envelope MessageQueue header
Definition at line 540 of file FreeRTOS.h.
| #define STATIC_QUEUE_TCB_SIZE_WORDS 24U |
Opaque buffer type that the caller must supply for xQueueCreateStatic(). Must be at least sizeof(StaticQueue_t) bytes. Declared as a fixed-size array of uintptr_t to enforce natural alignment without exposing FrtosQueue internals. Size is conservative: covers FrtosQueue on all supported targets.
Definition at line 486 of file FreeRTOS.h.
| #define STATIC_SEMAPHORE_TCB_SIZE_WORDS 8U |
Opaque buffer type that the caller must supply for xSemaphoreCreateBinaryStatic() and related static semaphore/mutex creation functions. Must be at least sizeof(FrtosSemaphore) bytes. Declared as a fixed-size array of uintptr_t to enforce natural alignment without exposing FrtosSemaphore internals. Size is conservative: covers FrtosSemaphore on all supported targets.
Definition at line 497 of file FreeRTOS.h.
| #define STATIC_STREAM_BUFFER_TCB_SIZE_WORDS 26U |
Opaque buffer type for xStreamBufferCreateStatic() and xStreamBufferCreateStaticWithCallback(). Covers FrtosStreamBuffer (Pipe + trigger level + ownership flags + two StreamBufferCallbackFunction_t pointers) on all supported STK targets. Size is conservative (+2 words vs the pre-callback layout).
Definition at line 529 of file FreeRTOS.h.
| #define STATIC_TASK_TCB_SIZE_WORDS |
Opaque buffer type that the caller must supply for xTaskCreateStatic(). Must be at least sizeof(StaticTask_t) bytes; declared as a fixed-size array of uintptr_t so the compiler enforces natural alignment without requiring knowledge of FrtosTask internals. Size is conservative: covers FrtosTask on all supported STK targets.
Definition at line 475 of file FreeRTOS.h.
| #define STATIC_TIMER_TCB_SIZE_WORDS 16U |
Opaque buffer type that the caller must supply for xTimerCreateStatic(). Must be at least sizeof(FrtosTimer) bytes. Declared as a fixed-size array of uintptr_t to enforce natural alignment without exposing FrtosTimer internals. Size is conservative: covers FrtosTimer (vtable ptr + base + 5 members) on all supported targets.
Definition at line 508 of file FreeRTOS.h.
| #define taskDISABLE_INTERRUPTS | ( | ) |
Definition at line 405 of file FreeRTOS.h.
| #define taskENABLE_INTERRUPTS | ( | ) |
Definition at line 406 of file FreeRTOS.h.
| #define taskENTER_CRITICAL | ( | ) |
Definition at line 403 of file FreeRTOS.h.
| #define taskEXIT_CRITICAL | ( | ) |
Definition at line 404 of file FreeRTOS.h.
| #define taskSCHEDULER_NOT_STARTED ((BaseType_t)0) |
Scheduler has not yet been started (STATE_INACTIVE / STATE_READY).
Definition at line 438 of file FreeRTOS.h.
Referenced by xTaskGetSchedulerState().
| #define taskSCHEDULER_RUNNING ((BaseType_t)1) |
Scheduler is running normally (STATE_RUNNING).
Definition at line 439 of file FreeRTOS.h.
Referenced by xTaskGetSchedulerState().
| #define taskSCHEDULER_SUSPENDED ((BaseType_t)2) |
Scheduler is suspended via vTaskSuspendAll() (STATE_SUSPENDED).
Definition at line 440 of file FreeRTOS.h.
Referenced by xTaskGetSchedulerState().
| #define taskYIELD | ( | ) |
Definition at line 407 of file FreeRTOS.h.
| #define tskIDLE_PRIORITY ((UBaseType_t)0U) |
Idle task priority.
Definition at line 2208 of file FreeRTOS.h.
Referenced by FrtosTask::FrtosTask().
| #define xTaskHandle TaskHandle_t |
Legacy handle alias.
Definition at line 2209 of file FreeRTOS.h.
| typedef long BaseType_t |
Definition at line 257 of file FreeRTOS.h.
| typedef uint32_t EventBits_t |
Bitmask for event group operations (bits 0..23 per FreeRTOS convention).
Definition at line 380 of file FreeRTOS.h.
| typedef void* EventGroupHandle_t |
Handle for an event group.
Definition at line 314 of file FreeRTOS.h.
| typedef void* MessageBufferHandle_t |
Handle for a message buffer.
Definition at line 316 of file FreeRTOS.h.
| typedef void(* PendedFunction_t) (void *pvParameter1, uint32_t ulParameter2) |
Callback for xTimerPendFunctionCall().
Definition at line 328 of file FreeRTOS.h.
| typedef long portBASE_TYPE |
Definition at line 259 of file FreeRTOS.h.
| typedef void* QueueHandle_t |
Handle for a queue.
Definition at line 311 of file FreeRTOS.h.
| typedef void* QueueSetHandle_t |
Definition at line 319 of file FreeRTOS.h.
| typedef void* QueueSetMemberHandle_t |
Definition at line 320 of file FreeRTOS.h.
| typedef void* SemaphoreHandle_t |
Handle for a semaphore/mutex.
Definition at line 312 of file FreeRTOS.h.
| typedef uintptr_t StackType_t |
Native-word stack element type, matches stk::Word.
Definition at line 260 of file FreeRTOS.h.
| typedef void(* StreamBufferCallbackFunction_t) (StreamBufferHandle_t xStreamBuffer, BaseType_t *pxHigherPriorityTaskWoken) |
Stream / message buffer send-complete and receive-complete callback. Invoked after bytes are successfully written (send) or read (receive) from the buffer. \a xHigherPriorityTaskWoken is always set to pdFALSE by the STK backend; it is included only for FreeRTOS API compatibility. May be NULL (no callback).
Definition at line 336 of file FreeRTOS.h.
| typedef void* StreamBufferHandle_t |
Handle for a stream buffer.
Definition at line 315 of file FreeRTOS.h.
| typedef void(* TaskFunction_t) (void *pvParameters) |
Task entry function.
Definition at line 326 of file FreeRTOS.h.
| typedef void* TaskHandle_t |
Handle for a task.
Definition at line 310 of file FreeRTOS.h.
| typedef uint32_t TickType_t |
Definition at line 256 of file FreeRTOS.h.
| typedef void(* TimerCallbackFunction_t) (TimerHandle_t xTimer) |
Timer expiry callback.
Definition at line 327 of file FreeRTOS.h.
| typedef void* TimerHandle_t |
Handle for a software timer.
Definition at line 313 of file FreeRTOS.h.
| typedef unsigned long UBaseType_t |
Definition at line 258 of file FreeRTOS.h.
| enum eNotifyAction |
Action applied to a task's notification value by xTaskNotify().
Definition at line 294 of file FreeRTOS.h.
| enum eTaskState |
Task execution state, returned by eTaskGetState().
| Enumerator | |
|---|---|
| eRunning | Task is actively executing on the CPU. |
| eReady | Task is in the ready list, eligible to run. |
| eBlocked | Task is waiting for an event or timeout. |
| eSuspended | Task is explicitly suspended via vTaskSuspend(). |
| eDeleted | Task has been deleted but not yet cleaned up. |
| eInvalid | Invalid / unknown state. |
Definition at line 279 of file FreeRTOS.h.
| eTaskState eTaskGetState | ( | TaskHandle_t | xTask | ) |
Return the current execution state of a task.
| xTask | Handle of the task to query. |
Definition at line 1345 of file freertos_stk.cpp.
References FrtosTask::Deleted, eDeleted, eInvalid, eReady, eRunning, eSuspended, stk::GetTid(), FrtosTask::m_state, and FrtosTask::Suspended.
| const char * pcTaskGetName | ( | TaskHandle_t | xTaskToQuery | ) |
Return the name string of a task.
| xTaskToQuery | Handle of the task to query, or NULL for the calling task. |
Definition at line 1395 of file freertos_stk.cpp.
| const char * pcTimerGetName | ( | TimerHandle_t | xTimer | ) |
Return the name string of a timer.
| xTimer | Handle of the timer to query. |
Definition at line 2918 of file freertos_stk.cpp.
| void * pvPortMalloc | ( | size_t | xWantedSize | ) |
Allocate xWantedSize bytes from the system heap.
malloc. Definition at line 203 of file freertos_stk.cpp.
References __stk_weak, and stk::memory::MemoryAllocator::Allocate().
Referenced by ObjAlloc(), and ObjAllocArray().
| void * pvTaskGetThreadLocalStoragePointer | ( | TaskHandle_t | xTaskToQuery, |
| BaseType_t | xIndex ) |
Read a TLS pointer slot for a task.
| xTaskToQuery | Task handle, or NULL for the calling task. |
| xIndex | Slot index (0 .. configNUM_THREAD_LOCAL_STORAGE_POINTERS-1). |
< Per-task TLS pointer slots.
Definition at line 3682 of file freertos_stk.cpp.
References configNUM_THREAD_LOCAL_STORAGE_POINTERS, FrtosTask::m_tls, and xTaskGetCurrentTaskHandle().
| void * pvTimerGetTimerID | ( | TimerHandle_t | xTimer | ) |
Return the application-defined ID stored in a timer.
| xTimer | Handle of the timer to query. |
Definition at line 2902 of file freertos_stk.cpp.
| void taskYIELD_impl | ( | void | ) |
Request an immediate context switch to the highest-priority ready task. Called by the taskYIELD() and portYIELD() macros.
Definition at line 380 of file freertos_stk.cpp.
References stk::Yield().
| uint32_t ulTaskNotifyTake | ( | BaseType_t | ulClearCountOnExit, |
| TickType_t | xTicksToWait ) |
Receive a notification (slot 0), optionally clearing or decrementing the value.
| ulClearCountOnExit | pdTRUE = clear to 0 on exit, pdFALSE = decrement by 1. |
| xTicksToWait | Ticks to wait for a notification. |
Definition at line 3400 of file freertos_stk.cpp.
References ulTaskNotifyTakeIndexed().
| uint32_t ulTaskNotifyTakeIndexed | ( | UBaseType_t | uxIndexToWait, |
| BaseType_t | ulClearCountOnExit, | ||
| TickType_t | xTicksToWait ) |
Receive a notification from a specific slot of the calling task.
| uxIndexToWait | Notification slot index. |
| ulClearCountOnExit | pdTRUE = clear slot value to 0, pdFALSE = decrement by 1. |
| xTicksToWait | Ticks to wait. |
Definition at line 3283 of file freertos_stk.cpp.
References FrtosTimeoutToStk(), IsIrqContext(), FrtosTask::m_notify, pdTRUE, ResolveNotifyTarget(), FrtosTask::NotifySlot::sem, FrtosTask::NotifySlot::value, and stk::sync::Semaphore::Wait().
Referenced by ulTaskNotifyTake().
| uint32_t ulTaskNotifyValueClear | ( | TaskHandle_t | xTask, |
| uint32_t | ulBitsToClear ) |
Atomically clear the specified bits in the notification value of slot 0 of a task, and return the value of the notification word before the bits were cleared.
| xTask | Handle of the task. NULL selects the calling task. |
| ulBitsToClear | Bitmask of bits to clear (ANDed with complement). Pass 0xFFFFFFFF to clear all bits. |
Definition at line 3635 of file freertos_stk.cpp.
References ulTaskNotifyValueClearIndexed().
| uint32_t ulTaskNotifyValueClearIndexed | ( | TaskHandle_t | xTask, |
| UBaseType_t | uxIndexToClear, | ||
| uint32_t | ulBitsToClear ) |
Indexed variant of ulTaskNotifyValueClear.
| xTask | Handle of the task. NULL selects the calling task. |
| uxIndexToClear | Notification slot index. |
| ulBitsToClear | Bitmask of bits to clear. |
Definition at line 3613 of file freertos_stk.cpp.
References FrtosTask::m_notify, ResolveNotifyTarget(), and FrtosTask::NotifySlot::value.
Referenced by ulTaskNotifyValueClear().
| UBaseType_t uxQueueMessagesWaiting | ( | QueueHandle_t | xQueue | ) |
Return the number of items currently in the queue.
| xQueue | Handle of the queue to inspect. |
Definition at line 1815 of file freertos_stk.cpp.
References stk::sync::MessageQueue::GetCount(), and FrtosQueue::m_mq.
| UBaseType_t uxQueueMessagesWaitingFromISR | ( | QueueHandle_t | xQueue | ) |
Return the number of items currently in the queue from ISR context.
| xQueue | Handle of the queue to inspect. |
Definition at line 1824 of file freertos_stk.cpp.
References stk::sync::MessageQueue::GetCount(), and FrtosQueue::m_mq.
| UBaseType_t uxQueueSpacesAvailable | ( | QueueHandle_t | xQueue | ) |
Return the number of free slots in the queue.
| xQueue | Handle of the queue to inspect. |
Definition at line 1834 of file freertos_stk.cpp.
References stk::sync::MessageQueue::GetSpace(), and FrtosQueue::m_mq.
| UBaseType_t uxSemaphoreGetCount | ( | SemaphoreHandle_t | xSemaphore | ) |
Return the current count of a counting semaphore, or 1/0 for a mutex (1 = unlocked, 0 = locked).
| xSemaphore | Handle of the semaphore or mutex to query. |
Definition at line 2519 of file freertos_stk.cpp.
References Counting, stk::sync::Semaphore::GetCount(), stk::sync::Mutex::GetOwner(), FrtosSemaphore::m_kind, FrtosSemaphore::m_mtx, FrtosSemaphore::m_sem, and stk::TID_NONE.
| UBaseType_t uxTaskGetNumberOfTasks | ( | void | ) |
Return the number of tasks currently under kernel management.
Definition at line 1101 of file freertos_stk.cpp.
References g_StkKernel.
| UBaseType_t uxTaskGetStackHighWaterMark | ( | TaskHandle_t | xTask | ) |
Return the unused stack depth high-water mark in Words. Pass NULL for the calling task.
| xTask | Handle of the task to query, or NULL for the calling task. |
Definition at line 1403 of file freertos_stk.cpp.
References FrtosTask::GetStackHighWaterMark(), and stk::GetTid().
| StackType_t uxTaskGetStackHighWaterMark2 | ( | TaskHandle_t | xTask | ) |
Return the unused stack depth high-water mark in Words. Pass NULL for the calling task.
| xTask | Handle of the task to query, or NULL for the calling task. |
< Stack depth word type.
< Stack depth word type.
Definition at line 1414 of file freertos_stk.cpp.
References configSTACK_DEPTH_TYPE, FrtosTask::GetStackHighWaterMark(), and stk::GetTid().
| UBaseType_t uxTaskGetSystemState | ( | TaskStatus_t * | pxTaskStatusArray, |
| UBaseType_t | uxArraySize, | ||
| uint32_t * | pulTotalRunTime ) |
Populate an array of TaskStatus_t with a snapshot of every task's state.
| pxTaskStatusArray | Caller-supplied array of at least uxArraySize elements. |
| uxArraySize | Capacity of pxTaskStatusArray (should be >= uxTaskGetNumberOfTasks()). |
| pulTotalRunTime | Receives 0 (STK has no global run-time counter). May be NULL. |
< Stack depth word type.
Definition at line 1425 of file freertos_stk.cpp.
References configSTACK_DEPTH_TYPE, FrtosTask::Deleted, TaskStatus_t::eCurrentState, eDeleted, eReady, eRunning, eSuspended, FREERTOS_STK_MAX_TASKS, g_StkKernel, FrtosTask::GetStackHighWaterMark(), stk::GetTid(), FrtosTask::m_name, FrtosTask::m_stack, FrtosTask::m_state, FrtosTask::m_task_number, FrtosTask::m_weight, TaskStatus_t::pcTaskName, TaskStatus_t::pxStackBase, StkWeightToFrtosPrio(), FrtosTask::Suspended, TaskStatus_t::ulRunTimeCounter, TaskStatus_t::usStackHighWaterMark, TaskStatus_t::uxBasePriority, TaskStatus_t::uxCurrentPriority, TaskStatus_t::xHandle, and TaskStatus_t::xTaskNumber.
| UBaseType_t uxTaskPriorityGet | ( | TaskHandle_t | xTask | ) |
Query the priority of a task. Pass NULL xTask for the calling task.
| xTask | Handle of the task to query, or NULL for the calling task. |
Definition at line 1329 of file freertos_stk.cpp.
References stk::GetTid(), FrtosTask::m_weight, and StkWeightToFrtosPrio().
Referenced by uxTaskPriorityGetFromISR().
| UBaseType_t uxTaskPriorityGetFromISR | ( | TaskHandle_t | xTask | ) |
Query the priority of a task from ISR context (ISR-safe).
| xTask | Handle of the task to query. |
Definition at line 1340 of file freertos_stk.cpp.
References uxTaskPriorityGet().
| void vEventGroupDelete | ( | EventGroupHandle_t | xEventGroup | ) |
Delete an event group and free its memory.
| xEventGroup | Handle of the event group to delete. |
Definition at line 3011 of file freertos_stk.cpp.
References ObjFree().
| void vMessageBufferDelete | ( | MessageBufferHandle_t | xMessageBuffer | ) |
Delete a message buffer and free heap resources (if dynamically allocated).
| xMessageBuffer | Handle of the message buffer to delete. |
Definition at line 4225 of file freertos_stk.cpp.
References ObjFree().
| void vPortEnterCritical | ( | void | ) |
Enter a critical section by disabling preemption and interrupts. Calls may be nested; each call must be balanced by a matching vPortExitCritical().
Definition at line 370 of file freertos_stk.cpp.
References stk::hw::CriticalSection::Enter().
| void vPortExitCritical | ( | void | ) |
Exit a critical section previously entered with vPortEnterCritical(). Re-enables preemption and interrupts only when the outermost nesting level is exited.
Definition at line 375 of file freertos_stk.cpp.
References stk::hw::CriticalSection::Exit().
| void vPortFree | ( | void * | pv | ) |
Free a block previously returned by pvPortMalloc().
| pv | Pointer to the block to free. NULL is a no-op. |
Definition at line 208 of file freertos_stk.cpp.
References __stk_weak, and stk::memory::MemoryAllocator::Free().
Referenced by ObjFree(), ObjFreeArray(), and ObjFreeRaw().
| void vPortGetHeapStats | ( | HeapStats_t * | pxHeapStats | ) |
Fill pxHeapStats with a snapshot of the heap statistics.
Fields that require traversal of the internal free-block list are reported conservatively (see HeapStats_t documentation); all other fields are exact.
| pxHeapStats | Pointer to the HeapStats_t structure to fill. NULL is silently ignored. |
Definition at line 252 of file freertos_stk.cpp.
References stk::memory::MemoryAllocator::Stats::allocate_count, stk::memory::MemoryAllocator::Stats::free_count, stk::memory::MemoryAllocator::Stats::GetAvailable(), stk::memory::MemoryAllocator::Stats::min_ever_free, s_MemStats, HeapStats_t::xAvailableHeapSpaceInBytes, HeapStats_t::xMinimumEverFreeBytesRemaining, HeapStats_t::xNumberOfFreeBlocks, HeapStats_t::xNumberOfSuccessfulAllocations, HeapStats_t::xNumberOfSuccessfulFrees, HeapStats_t::xSizeOfLargestFreeBlockInBytes, and HeapStats_t::xSizeOfSmallestFreeBlockInBytes.
| void vQueueDelete | ( | QueueHandle_t | xQueue | ) |
Delete a queue and free all associated memory.
| xQueue | Handle of the queue to delete. |
Definition at line 1719 of file freertos_stk.cpp.
References ObjFree().
| void vSemaphoreDelete | ( | SemaphoreHandle_t | xSemaphore | ) |
Delete a semaphore or mutex and free its memory.
| xSemaphore | Handle of the semaphore or mutex to delete. |
Definition at line 2399 of file freertos_stk.cpp.
References ObjFree().
| void vStreamBufferDelete | ( | StreamBufferHandle_t | xStreamBuffer | ) |
Delete a stream buffer and free heap resources (if dynamically allocated).
| xStreamBuffer | Handle of the stream buffer to delete. |
Definition at line 3773 of file freertos_stk.cpp.
References ObjFree().
| void vTaskDelay | ( | TickType_t | xTicksToDelay | ) |
Block the calling task for a number of ticks.
| xTicksToDelay | Number of ticks to block. 0 yields without blocking. |
Definition at line 1292 of file freertos_stk.cpp.
References FrtosTimeoutToStk(), IsIrqContext(), and stk::Sleep().
| void vTaskDelayUntil | ( | TickType_t * | pxPreviousWakeTime, |
| TickType_t | xTimeIncrement ) |
Block until an absolute tick deadline for drift-free periodic loops. Updates *pxPreviousWakeTime on each call.
| pxPreviousWakeTime | In/out: tick count at the last wake point; updated on return. |
| xTimeIncrement | Period in ticks between successive wake points. |
Definition at line 1300 of file freertos_stk.cpp.
References xTaskDelayUntil().
| void vTaskDelete | ( | TaskHandle_t | xTaskToDelete | ) |
Delete a task. Pass NULL to delete the calling task.
| xTaskToDelete | Handle of the task to delete, or NULL to delete the calling task. |
Definition at line 1210 of file freertos_stk.cpp.
References g_StkKernel, stk::GetTid(), and ObjFree().
| void vTaskEndScheduler | ( | void | ) |
End scheduling (KERNEL_DYNAMIC only). Included for API completeness.
Definition at line 1069 of file freertos_stk.cpp.
References FREERTOS_STK_MAX_TASKS, g_StkKernel, and stk::Yield().
| void vTaskGetRunTimeStats | ( | char * | pcWriteBuffer | ) |
Write a human-readable CPU run-time statistics table into pcWriteBuffer.
Each row contains: task name, absolute run-time counter, and percentage of total run time. Column layout matches the standard FreeRTOS vTaskGetRunTimeStats() output so existing log parsers work unchanged.
configGENERATE_RUN_TIME_STATS is not enabled. The function is provided for link compatibility; applications that need real CPU accounting must instrument the target with a free-running hardware counter and replace the two MemoryAllocator definitions in freertos_stk.cpp with the appropriate port-layer calls.| pcWriteBuffer | Caller-allocated destination buffer. A safe minimum is uxTaskGetNumberOfTasks() * 40 bytes. |
Definition at line 1620 of file freertos_stk.cpp.
References FREERTOS_STK_MAX_TASKS, g_StkKernel, and FrtosTask::m_name.
| void vTaskList | ( | char * | pcWriteBuffer | ) |
Write a human-readable task-status table into pcWriteBuffer.
Each row contains: name, state letter (X/R/B/S/D), priority, stack high-water mark (Words), and a 1-based task number. Column widths match the standard FreeRTOS vTaskList() output so that existing tools and log parsers work without modification.
| pcWriteBuffer | Caller-allocated destination buffer. Must be large enough for all active tasks. A safe minimum is uxTaskGetNumberOfTasks() * 40 bytes. |
Definition at line 1549 of file freertos_stk.cpp.
References FrtosTask::Deleted, FREERTOS_STK_MAX_TASKS, g_StkKernel, FrtosTask::GetStackHighWaterMark(), stk::GetTid(), FrtosTask::m_name, FrtosTask::m_state, FrtosTask::m_weight, StkWeightToFrtosPrio(), and FrtosTask::Suspended.
| void vTaskPrioritySet | ( | TaskHandle_t | xTask, |
| UBaseType_t | uxNewPriority ) |
Change the priority of a task. Pass NULL xTask for the calling task.
| xTask | Handle of the task to modify, or NULL for the calling task. |
| uxNewPriority | New priority level (0 = lowest, configMAX_PRIORITIES-1 = highest). |
Definition at line 1318 of file freertos_stk.cpp.
References FrtosPrioToStkWeight(), stk::GetTid(), and FrtosTask::m_weight.
| void vTaskResume | ( | TaskHandle_t | xTaskToResume | ) |
Resume a previously suspended task.
| xTaskToResume | Handle of the task to resume. |
Definition at line 1242 of file freertos_stk.cpp.
References g_StkKernel, FrtosTask::m_state, FrtosTask::Ready, and FrtosTask::Suspended.
| void vTaskSetThreadLocalStoragePointer | ( | TaskHandle_t | xTaskToSet, |
| BaseType_t | xIndex, | ||
| void * | pvValue ) |
Write a TLS pointer slot for a task.
| xTaskToSet | Task handle, or NULL for the calling task. |
| xIndex | Slot index (0 .. configNUM_THREAD_LOCAL_STORAGE_POINTERS-1). |
| pvValue | Value to store. |
< Per-task TLS pointer slots.
Definition at line 3659 of file freertos_stk.cpp.
References configNUM_THREAD_LOCAL_STORAGE_POINTERS, FrtosTask::m_tls, and xTaskGetCurrentTaskHandle().
| void vTaskStartScheduler | ( | void | ) |
Initialise STK and start the scheduler. Does not return for KERNEL_DYNAMIC until all tasks have exited.
Definition at line 1062 of file freertos_stk.cpp.
References EnsureKernelInitialized(), and g_StkKernel.
| void vTaskSuspend | ( | TaskHandle_t | xTaskToSuspend | ) |
Suspend a task indefinitely. Pass NULL to suspend the calling task.
| xTaskToSuspend | Handle of the task to suspend, or NULL for the calling task. |
Definition at line 1228 of file freertos_stk.cpp.
References g_StkKernel, stk::GetTid(), FrtosTask::m_state, and FrtosTask::Suspended.
| void vTaskSuspendAll | ( | void | ) |
Suspend the scheduler (disables preemption; interrupts remain enabled).
Definition at line 1080 of file freertos_stk.cpp.
References stk::hw::CriticalSection::Enter().
| void vTimerSetTimerID | ( | TimerHandle_t | xTimer, |
| void * | pvNewID ) |
Set the application-defined ID stored in a timer.
| xTimer | Handle of the timer to modify. |
| pvNewID | New ID value to store in the timer. |
Definition at line 2910 of file freertos_stk.cpp.
| EventBits_t xEventGroupClearBits | ( | EventGroupHandle_t | xEventGroup, |
| EventBits_t | uxBitsToClear ) |
Clear one or more bits in an event group (ISR-safe).
| xEventGroup | Handle of the event group to modify. |
| uxBitsToClear | Bitmask of bits to clear (ANDed with complement into the current value). |
Definition at line 3029 of file freertos_stk.cpp.
References StkFlagsToFrtos().
| EventBits_t xEventGroupClearBitsFromISR | ( | EventGroupHandle_t | xEventGroup, |
| EventBits_t | uxBitsToClear ) |
Clear event group bits from ISR context.
| xEventGroup | Handle of the event group to modify. |
| uxBitsToClear | Bitmask of bits to clear. |
Definition at line 3087 of file freertos_stk.cpp.
References StkFlagsToFrtos().
| EventGroupHandle_t xEventGroupCreate | ( | void | ) |
Create an event group (all bits initialised to 0).
Definition at line 2984 of file freertos_stk.cpp.
References IsIrqContext(), and ObjAlloc().
| EventGroupHandle_t xEventGroupCreateStatic | ( | StaticEventGroup_t * | pxEventGroupBuffer | ) |
Create an event group using caller-supplied storage — no heap allocation.
| pxEventGroupBuffer | Caller-allocated control block (StaticEventGroup_t). Must remain valid for the lifetime of the event group. |
Definition at line 2993 of file freertos_stk.cpp.
References IsIrqContext(), and FrtosEventGroup::m_cb_owned.
| EventBits_t xEventGroupGetBits | ( | EventGroupHandle_t | xEventGroup | ) |
Return the current event group bits without blocking or modifying them.
| xEventGroup | Handle of the event group to read. |
Definition at line 3040 of file freertos_stk.cpp.
References stk::sync::EventFlags::Get(), and FrtosEventGroup::m_ef.
| EventBits_t xEventGroupSetBits | ( | EventGroupHandle_t | xEventGroup, |
| EventBits_t | uxBitsToSet ) |
Set one or more bits in an event group (ISR-safe).
| xEventGroup | Handle of the event group to modify. |
| uxBitsToSet | Bitmask of bits to set (OR'd into the current value). |
Definition at line 3019 of file freertos_stk.cpp.
References StkFlagsToFrtos().
| BaseType_t xEventGroupSetBitsFromISR | ( | EventGroupHandle_t | xEventGroup, |
| EventBits_t | uxBitsToSet, | ||
| BaseType_t * | pxHigherPriorityTaskWoken ) |
Set event group bits from ISR context.
| xEventGroup | Handle of the event group to modify. |
| uxBitsToSet | Bitmask of bits to set. |
| pxHigherPriorityTaskWoken | Set pdTRUE if a context switch is needed. |
Definition at line 3071 of file freertos_stk.cpp.
References stk::sync::EventFlags::IsError(), pdFAIL, pdFALSE, and pdPASS.
| EventBits_t xEventGroupSync | ( | EventGroupHandle_t | xEventGroup, |
| EventBits_t | uxBitsToSet, | ||
| EventBits_t | uxBitsToWaitFor, | ||
| TickType_t | xTicksToWait ) |
Task rendezvous / barrier synchronization using an event group.
Atomically sets uxBitsToSet in the event group, then blocks until uxBitsToWaitFor are all set (AND semantics). On success, all bits in uxBitsToWaitFor are atomically cleared before returning.
| xEventGroup | Event group handle (must not be NULL). |
| uxBitsToSet | Bit(s) this task sets to signal it has reached the sync point (must be a subset of uxBitsToWaitFor). |
| uxBitsToWaitFor | Bitmask of ALL bits that must be set before any participating task is released (AND semantics). |
| xTicksToWait | Maximum ticks to wait. portMAX_DELAY = wait forever. NO_WAIT (0) performs a non-blocking test. |
Definition at line 3144 of file freertos_stk.cpp.
References FrtosTimeoutToStk(), stk::sync::EventFlags::IsError(), IsIrqContext(), FrtosEventGroup::m_ef, stk::sync::EventFlags::OPT_WAIT_ALL, stk::sync::EventFlags::Set(), STK_ASSERT, StkFlagsToFrtos(), and stk::sync::EventFlags::Wait().
| EventBits_t xEventGroupWaitBits | ( | EventGroupHandle_t | xEventGroup, |
| EventBits_t | uxBitsToWaitFor, | ||
| BaseType_t | xClearOnExit, | ||
| BaseType_t | xWaitForAllBits, | ||
| TickType_t | xTicksToWait ) |
Block the calling task until the specified bit condition is met.
| xEventGroup | Handle of the event group to wait on. |
| uxBitsToWaitFor | Bitmask of bits to watch. |
| xClearOnExit | pdTRUE = atomically clear matched bits on return. |
| xWaitForAllBits | pdTRUE = AND semantics, pdFALSE = OR semantics. |
| xTicksToWait | Maximum ticks to block. portMAX_DELAY = wait forever. |
Definition at line 3048 of file freertos_stk.cpp.
References BuildStkFlagsOpts(), FrtosTimeoutToStk(), stk::sync::EventFlags::Get(), IsIrqContext(), StkFlagsToFrtos(), and stk::sync::EventFlags::Wait().
| MessageBufferHandle_t xMessageBufferCreate | ( | size_t | xBufferSizeBytes, |
| size_t | xMaxMessageSize ) |
Create a dynamically allocated message buffer.
| xBufferSizeBytes | Total storage budget. The implementation derives slot count as floor(xBufferSizeBytes / (AlignBlockSize(xMaxMessageSize)
|
| xMaxMessageSize | Maximum payload size per message in bytes. |
Definition at line 4105 of file freertos_stk.cpp.
References stk::memory::BlockMemoryPool::IsStorageValid(), stk::sync::MessageQueue::IsStorageValid(), FrtosMessageBuffer::m_eq, FrtosMessageBuffer::m_pool, MsgBufSlotCount(), ObjAlloc(), and ObjFreeRaw().
| MessageBufferHandle_t xMessageBufferCreateStatic | ( | size_t | xMaxMessageSize, |
| size_t | xMessageCount, | ||
| uint8_t * | pucMessageBufferStorageArea, | ||
| StaticMessageBuffer_t * | pxStaticMessageBuffer ) |
Create a statically allocated message buffer (no heap).
| xMaxMessageSize | Maximum payload size per message. |
| xMessageCount | Maximum number of in-flight messages. |
| pucMessageBufferStorageArea | Caller-supplied flat buffer of at least xMessageCount * (AlignBlockSize(xMaxMessageSize) + sizeof(envelope)) bytes. |
| pxStaticMessageBuffer | Caller-supplied TCB (StaticMessageBuffer_t). |
Definition at line 4130 of file freertos_stk.cpp.
References stk::memory::BlockMemoryPool::AlignBlockSize(), and FrtosMessageBuffer::ENVELOPE_SIZE.
| MessageBufferHandle_t xMessageBufferCreateStaticWithCallback | ( | size_t | xMaxMessageSize, |
| size_t | xMessageCount, | ||
| uint8_t * | pucMessageBufferStorageArea, | ||
| StaticMessageBuffer_t * | pxStaticMessageBuffer, | ||
| StreamBufferCallbackFunction_t | pxSendCompletedCallback, | ||
| StreamBufferCallbackFunction_t | pxReceiveCompletedCallback ) |
Create a statically-allocated message buffer with optional send/receive callbacks.
Identical to xMessageBufferCreateStatic() but registers per-instance callbacks. Either callback may be NULL.
| xMaxMessageSize | Maximum payload size per message in bytes. |
| xMessageCount | Maximum number of in-flight messages. |
| pucMessageBufferStorageArea | Caller-supplied flat storage buffer. |
| pxStaticMessageBuffer | Caller-supplied TCB (StaticMessageBuffer_t). |
| pxSendCompletedCallback | Called after a message is enqueued (or NULL). |
| pxReceiveCompletedCallback | Called after a message is dequeued (or NULL). |
Definition at line 4197 of file freertos_stk.cpp.
References stk::memory::BlockMemoryPool::AlignBlockSize(), and FrtosMessageBuffer::ENVELOPE_SIZE.
| MessageBufferHandle_t xMessageBufferCreateWithCallback | ( | size_t | xBufferSizeBytes, |
| size_t | xMaxMessageSize, | ||
| StreamBufferCallbackFunction_t | pxSendCompletedCallback, | ||
| StreamBufferCallbackFunction_t | pxReceiveCompletedCallback ) |
Create a heap-allocated message buffer with optional send/receive callbacks.
Identical to xMessageBufferCreate() but registers per-instance callbacks invoked after a message is successfully enqueued (pxSendCompletedCallback) or dequeued (pxReceiveCompletedCallback). Either callback may be NULL. Callbacks fire outside any critical section, after the transfer completes. The xStreamBuffer argument passed to the callback is the MessageBufferHandle_t cast to StreamBufferHandle_t, matching FreeRTOS convention.
| xBufferSizeBytes | Total storage budget (slot count derived internally). |
| xMaxMessageSize | Maximum payload size per message in bytes. |
| pxSendCompletedCallback | Called after a message is enqueued (or NULL). |
| pxReceiveCompletedCallback | Called after a message is dequeued (or NULL). |
Definition at line 4163 of file freertos_stk.cpp.
References stk::memory::BlockMemoryPool::AlignBlockSize(), FrtosMessageBuffer::ENVELOPE_SIZE, stk::sync::MessageQueue::IsStorageValid(), FrtosMessageBuffer::m_eq, ObjAlloc(), and ObjFreeRaw().
| BaseType_t xMessageBufferIsEmpty | ( | MessageBufferHandle_t | xMessageBuffer | ) |
Return pdTRUE if the message buffer contains no messages.
| xMessageBuffer | Handle of the message buffer. |
Definition at line 4326 of file freertos_stk.cpp.
| BaseType_t xMessageBufferIsFull | ( | MessageBufferHandle_t | xMessageBuffer | ) |
Return pdTRUE if no more messages can be enqueued (pool exhausted).
| xMessageBuffer | Handle of the message buffer. |
Definition at line 4335 of file freertos_stk.cpp.
| size_t xMessageBufferNextLengthBytes | ( | MessageBufferHandle_t | xMessageBuffer | ) |
Return the byte length of the next message that would be returned by xMessageBufferReceive(), without removing it from the buffer.
Backed by stk::sync::MessageQueue::TryPeek(), which copies the oldest envelope atomically without consuming it. No dequeue-and-reinsert pair is needed; the queue state is left unchanged in a single ISR-safe operation.
| xMessageBuffer | Handle of the message buffer. |
Definition at line 4541 of file freertos_stk.cpp.
References FrtosMessageBuffer::MsgEnvelope::len, FrtosMessageBuffer::m_eq, and stk::sync::MessageQueue::TryPeek().
| size_t xMessageBufferReceive | ( | MessageBufferHandle_t | xMessageBuffer, |
| void * | pvRxData, | ||
| size_t | xBufferLengthBytes, | ||
| TickType_t | xTicksToWait ) |
Receive a message from the message buffer (task context, may block).
| xMessageBuffer | Handle of the message buffer to receive from. |
| pvRxData | Destination buffer. |
| xBufferLengthBytes | Capacity of pvRxData; must be >= the oldest message length. |
| xTicksToWait | Ticks to wait for a message. portMAX_DELAY blocks indefinitely. |
Definition at line 4283 of file freertos_stk.cpp.
References FrtosMessageBuffer::MsgEnvelope::blk, stk::memory::BlockMemoryPool::Free(), FrtosTimeoutToStk(), stk::sync::MessageQueue::Get(), IsIrqContext(), FrtosMessageBuffer::MsgEnvelope::len, FrtosMessageBuffer::m_eq, FrtosMessageBuffer::m_pool, FrtosMessageBuffer::m_recv_cb, pdFALSE, STK_ASSERT, STK_MEMCPY(), and stk::sync::MessageQueue::TryPut().
| size_t xMessageBufferReceiveFromISR | ( | MessageBufferHandle_t | xMessageBuffer, |
| void * | pvRxData, | ||
| size_t | xBufferLengthBytes, | ||
| BaseType_t * | pxHigherPriorityTaskWoken ) |
Receive a message from the message buffer from ISR context (non-blocking).
Attempts to dequeue one envelope without blocking. If an envelope is available and fits in the destination buffer the payload is copied out and the pool block is freed.
| xMessageBuffer | Handle of the message buffer to receive from. |
| pvRxData | Destination buffer. |
| xBufferLengthBytes | Capacity of pvRxData; must be >= the oldest message length. |
| pxHigherPriorityTaskWoken | Always set to pdFALSE; STK handles scheduling. |
Definition at line 4470 of file freertos_stk.cpp.
References FrtosMessageBuffer::MsgEnvelope::blk, stk::memory::BlockMemoryPool::Free(), FrtosMessageBuffer::MsgEnvelope::len, FrtosMessageBuffer::m_eq, FrtosMessageBuffer::m_pool, FrtosMessageBuffer::m_recv_cb, pdFALSE, STK_ASSERT, STK_MEMCPY(), stk::sync::MessageQueue::TryGet(), and stk::sync::MessageQueue::TryPutFront().
| BaseType_t xMessageBufferReset | ( | MessageBufferHandle_t | xMessageBuffer | ) |
Discard all pending messages, return all blocks to the pool, and reset the envelope queue to the empty state (task context).
Definition at line 4353 of file freertos_stk.cpp.
References FrtosMessageBuffer::MsgEnvelope::blk, stk::memory::BlockMemoryPool::Free(), FrtosMessageBuffer::m_eq, FrtosMessageBuffer::m_pool, pdFAIL, pdPASS, stk::sync::MessageQueue::Reset(), and stk::sync::MessageQueue::TryGet().
| BaseType_t xMessageBufferResetFromISR | ( | MessageBufferHandle_t | xMessageBuffer, |
| BaseType_t * | pxHigherPriorityTaskWoken ) |
Discard all pending messages and reset the buffer from ISR context.
Drains every pending envelope, frees its pool block, then resets the envelope queue. Wakes any task blocked in xMessageBufferSend() that was waiting for a free slot.
| xMessageBuffer | Handle of the message buffer. |
| pxHigherPriorityTaskWoken | Always set to pdFALSE; STK handles scheduling. |
Definition at line 4514 of file freertos_stk.cpp.
References FrtosMessageBuffer::MsgEnvelope::blk, stk::memory::BlockMemoryPool::Free(), FrtosMessageBuffer::m_eq, FrtosMessageBuffer::m_pool, pdFAIL, pdFALSE, pdPASS, stk::sync::MessageQueue::Reset(), and stk::sync::MessageQueue::TryGet().
| size_t xMessageBufferSend | ( | MessageBufferHandle_t | xMessageBuffer, |
| const void * | pvTxData, | ||
| size_t | xDataLengthBytes, | ||
| TickType_t | xTicksToWait ) |
Send a message into the message buffer (task context, may block).
| xMessageBuffer | Handle of the message buffer to send to. |
| pvTxData | Pointer to message payload. |
| xDataLengthBytes | Payload size in bytes (must be <= max message size). |
| xTicksToWait | Ticks to wait for a free block + envelope slot. portMAX_DELAY blocks indefinitely. |
Definition at line 4235 of file freertos_stk.cpp.
References stk::memory::BlockMemoryPool::Free(), FrtosTimeoutToStk(), FrtosMessageBuffer::m_eq, FrtosMessageBuffer::m_max_msg_size, FrtosMessageBuffer::m_pool, FrtosMessageBuffer::m_send_cb, stk::NO_WAIT, pdFALSE, stk::sync::MessageQueue::Put(), STK_ASSERT, STK_MEMCPY(), and stk::memory::BlockMemoryPool::TimedAlloc().
| size_t xMessageBufferSendFromISR | ( | MessageBufferHandle_t | xMessageBuffer, |
| const void * | pvTxData, | ||
| size_t | xDataLengthBytes, | ||
| BaseType_t * | pxHigherPriorityTaskWoken ) |
Send a message into the message buffer from ISR context (non-blocking).
Attempts a single non-blocking pool allocation followed by a non-blocking envelope enqueue. Returns 0 immediately if either resource is unavailable.
| xMessageBuffer | Handle of the message buffer to send to. |
| pvTxData | Pointer to message payload. |
| xDataLengthBytes | Payload size (must be <= max message size). |
| pxHigherPriorityTaskWoken | Always set to pdFALSE; STK handles scheduling. |
Definition at line 4421 of file freertos_stk.cpp.
References stk::memory::BlockMemoryPool::Free(), FrtosMessageBuffer::m_eq, FrtosMessageBuffer::m_max_msg_size, FrtosMessageBuffer::m_pool, FrtosMessageBuffer::m_send_cb, stk::NO_WAIT, pdFALSE, STK_ASSERT, STK_MEMCPY(), stk::memory::BlockMemoryPool::TimedAlloc(), and stk::sync::MessageQueue::TryPut().
| size_t xMessageBufferSpacesAvailable | ( | MessageBufferHandle_t | xMessageBuffer | ) |
Return the number of free envelope slots available for sending.
| xMessageBuffer | Handle of the message buffer. |
Definition at line 4344 of file freertos_stk.cpp.
| size_t xPortGetFreeHeapSize | ( | void | ) |
Return the number of bytes currently available in the heap.
This is a point-in-time snapshot of stk::memory::MemoryAllocator::Stats::GetAvailable() and may not account for in-flight allocations if called from a non-critical context.
Definition at line 242 of file freertos_stk.cpp.
References s_MemStats.
| size_t xPortGetMinimumEverFreeHeapSize | ( | void | ) |
Return the minimum number of free heap bytes recorded since system start.
The watermark is updated inside MemoryAllocator::Allocate() after every successful allocation, so it always reflects the worst-case heap pressure observed up to the point of the call.
Definition at line 247 of file freertos_stk.cpp.
References s_MemStats.
| BaseType_t xQueueAddToSet | ( | QueueSetMemberHandle_t | xQueueOrSemaphore, |
| QueueSetHandle_t | xQueueSet ) |
Register a queue or binary/counting semaphore as a member of a queue set.
The member must be empty at the time it is added. Mutexes are not permitted. A member may belong to at most one set at a time.
| xQueueOrSemaphore | Handle of the queue or semaphore to add. |
| xQueueSet | Handle of the target queue set. |
Definition at line 2101 of file freertos_stk.cpp.
References stk::sync::Semaphore::GetCount(), GetSemKindFromHandle(), stk::sync::MessageQueue::IsEmpty(), FrtosSemaphore::m_kind, FrtosQueue::m_mq, FrtosSemaphore::m_sem, FrtosQueue::m_set, FrtosSemaphore::m_set, Mutex, None, pdFAIL, pdPASS, and STK_ASSERT.
| QueueHandle_t xQueueCreate | ( | UBaseType_t | uxQueueLength, |
| UBaseType_t | uxItemSize ) |
Create a queue capable of holding uxQueueLength items of uxItemSize bytes.
Definition at line 1659 of file freertos_stk.cpp.
References stk::sync::MessageQueue::CAPACITY_MAX, IsIrqContext(), stk::sync::MessageQueue::IsStorageValid(), FrtosQueue::m_mq, ObjAlloc(), and ObjFree().
| QueueSetHandle_t xQueueCreateSet | ( | UBaseType_t | uxEventQueueLength | ) |
Create a queue set that can supervise up to uxEventQueueLength simultaneous item-available notifications from its member queues and semaphores.
| uxEventQueueLength | Total event capacity. Must be >= the sum of the capacities (uxQueueLength or max_count) of all queues and semaphores that will be added. |
Definition at line 2082 of file freertos_stk.cpp.
References stk::sync::MessageQueue::CAPACITY_MAX, IsIrqContext(), FrtosQueueSet::IsValid(), ObjAlloc(), and ObjFree().
| QueueHandle_t xQueueCreateStatic | ( | UBaseType_t | uxQueueLength, |
| UBaseType_t | uxItemSize, | ||
| uint8_t * | pucQueueStorage, | ||
| StaticQueue_t * | pxStaticQueue ) |
Create a queue using caller-supplied storage — no heap allocation.
| uxQueueLength | Maximum number of items the queue can hold (>= 1). |
| uxItemSize | Size of each item in bytes (>= 1). |
| pucQueueStorage | Caller-allocated data buffer of at least uxQueueLength * uxItemSize bytes. Must remain valid for the entire lifetime of the queue. |
| pxStaticQueue | Caller-allocated queue control block (StaticQueue_t). Must remain valid for the entire lifetime of the queue. |
Definition at line 1685 of file freertos_stk.cpp.
References stk::sync::MessageQueue::CAPACITY_MAX, IsIrqContext(), and FrtosQueue::m_cb_owned.
| TaskHandle_t xQueueGetMutexHolder | ( | QueueHandle_t | xQueue | ) |
Return the handle of the task that currently holds a mutex-semaphore when that semaphore is referenced by a QueueHandle_t alias.
In the FreeRTOS reference implementation mutex semaphores are built on top of the internal queue structure, so xQueueGetMutexHolder() and xSemaphoreGetMutexHolder() are the same function with different handle types. In this STK wrapper the two object types are separate structs:
FrtosQueue — backed by stk::sync::MessageQueue; has no owner field.FrtosSemaphore — backed by stk::sync::Semaphore (counting) or stk::sync::Mutex (mutex kind). Only the Mutex kind carries an owner and supports STK priority inheritance.This function accepts a QueueHandle_t and uses the same one-byte type-discriminant (offset 0: SemKind ≤ 1 → semaphore, otherwise → queue) already used by the Queue Set implementation to decide which path to take:
FrtosSemaphore with SemKind::Mutex, the call is forwarded to xSemaphoreGetMutexHolder() and the owning task handle (or NULL if unlocked) is returned.FrtosQueue handle, or for a counting/binary semaphore handle, NULL is returned — the owner concept does not apply.| xQueue | Handle typed as QueueHandle_t. May point to a mutex semaphore in application code that uses the raw queue handle alias (e.g. FreeRTOS+TCP internal usage). |
configUSE_MUTEXES == 1. Definition at line 2025 of file freertos_stk.cpp.
References QueueHandleAsMutex(), and xSemaphoreGetMutexHolder().
| TaskHandle_t xQueueGetMutexHolderFromISR | ( | QueueHandle_t | xQueue | ) |
ISR-safe variant of xQueueGetMutexHolder().
Reads the mutex owner field with a single pointer-sized load, which is naturally atomic on all supported STK architectures (Cortex-M and equivalents) without requiring an additional critical section.
| xQueue | Handle typed as QueueHandle_t. |
configUSE_MUTEXES == 1. Definition at line 2037 of file freertos_stk.cpp.
References QueueHandleAsMutex(), and xSemaphoreGetMutexHolderFromISR().
| BaseType_t xQueueIsQueueEmptyFromISR | ( | const QueueHandle_t | xQueue | ) |
Query whether a queue is empty from ISR context.
| xQueue | Handle of the queue to query. |
Definition at line 1955 of file freertos_stk.cpp.
| BaseType_t xQueueIsQueueFullFromISR | ( | const QueueHandle_t | xQueue | ) |
Query whether a queue is full from ISR context.
| xQueue | Handle of the queue to query. |
Definition at line 1965 of file freertos_stk.cpp.
| BaseType_t xQueueOverwrite | ( | QueueHandle_t | xQueue, |
| const void * | pvItemToQueue ) |
Overwrite the value stored in a queue of length 1 (mailbox pattern). If the queue is already full the existing item is discarded before writing.
| xQueue | Handle of the length-1 queue to overwrite. |
| pvItemToQueue | Pointer to the item to write into the queue. |
Definition at line 1852 of file freertos_stk.cpp.
References FrtosQueue::m_mq, pdFAIL, pdPASS, QueueSetNotify(), stk::sync::MessageQueue::Reset(), and stk::sync::MessageQueue::TryPut().
| BaseType_t xQueueOverwriteFromISR | ( | QueueHandle_t | xQueue, |
| const void * | pvItemToQueue, | ||
| BaseType_t * | pxHigherPriorityTaskWoken ) |
Overwrite the value stored in a length-1 queue from ISR context.
| xQueue | Handle of the length-1 queue to overwrite. |
| pvItemToQueue | Pointer to the item to write. |
| pxHigherPriorityTaskWoken | Set pdTRUE if a context switch is needed. |
Definition at line 1868 of file freertos_stk.cpp.
References FrtosQueue::m_mq, pdFAIL, pdFALSE, pdPASS, QueueSetNotify(), stk::sync::MessageQueue::Reset(), and stk::sync::MessageQueue::TryPut().
| BaseType_t xQueuePeek | ( | QueueHandle_t | xQueue, |
| void * | pvBuffer, | ||
| TickType_t | xTicksToWait ) |
Peek at the front item without removing it (blocking).
Copies the oldest item into pvBuffer without consuming it, so a subsequent xQueueReceive() will return the same item. The operation is fully atomic — backed by stk::sync::MessageQueue::Peek() which holds an internal critical section for the duration of the copy.
| xQueue | Handle of the queue to peek. |
| pvBuffer | Destination buffer; must be at least uxItemSize bytes. |
| xTicksToWait | Ticks to wait if the queue is empty. portMAX_DELAY waits indefinitely. |
Definition at line 1786 of file freertos_stk.cpp.
References FrtosTimeoutToStk(), IsIrqContext(), pdFAIL, and pdPASS.
| BaseType_t xQueuePeekFromISR | ( | QueueHandle_t | xQueue, |
| void * | pvBuffer ) |
Peek at the front item from ISR context without removing it (non-blocking).
Copies the oldest item into pvBuffer atomically without consuming it, backed by stk::sync::MessageQueue::TryPeek() which is ISR-safe.
| xQueue | Handle of the queue to peek. |
| pvBuffer | Destination buffer; must be at least uxItemSize bytes. |
Definition at line 1804 of file freertos_stk.cpp.
| BaseType_t xQueueReceive | ( | QueueHandle_t | xQueue, |
| void * | pvBuffer, | ||
| TickType_t | xTicksToWait ) |
Receive (dequeue) an item from a queue (blocking).
| xQueue | Handle of the source queue. |
| pvBuffer | Destination buffer; must be at least uxItemSize bytes. |
| xTicksToWait | Ticks to wait if the queue is empty. portMAX_DELAY = wait forever. |
Definition at line 1772 of file freertos_stk.cpp.
References FrtosTimeoutToStk(), IsIrqContext(), pdFAIL, and pdPASS.
| BaseType_t xQueueReceiveFromISR | ( | QueueHandle_t | xQueue, |
| void * | pvBuffer, | ||
| BaseType_t * | pxHigherPriorityTaskWoken ) |
Receive an item from ISR context (non-blocking).
| xQueue | Handle of the source queue. |
| pvBuffer | Destination buffer; must be at least uxItemSize bytes. |
| pxHigherPriorityTaskWoken | Set pdTRUE if a context switch is needed. |
Definition at line 1910 of file freertos_stk.cpp.
| BaseType_t xQueueRemoveFromSet | ( | QueueSetMemberHandle_t | xQueueOrSemaphore, |
| QueueSetHandle_t | xQueueSet ) |
Unregister a queue or semaphore from a queue set.
The member must be empty at the time it is removed.
| xQueueOrSemaphore | Handle of the queue or semaphore to remove. |
| xQueueSet | Handle of the queue set it currently belongs to. |
Definition at line 2154 of file freertos_stk.cpp.
References stk::sync::Semaphore::GetCount(), GetSemKindFromHandle(), stk::sync::MessageQueue::IsEmpty(), FrtosQueue::m_mq, FrtosSemaphore::m_sem, FrtosQueue::m_set, FrtosSemaphore::m_set, None, pdFAIL, pdPASS, and STK_ASSERT.
| BaseType_t xQueueReset | ( | QueueHandle_t | xQueue | ) |
Reset a queue to the empty state, discarding all pending items.
| xQueue | Handle of the queue to reset. |
Definition at line 1843 of file freertos_stk.cpp.
| QueueSetMemberHandle_t xQueueSelectFromSet | ( | QueueSetHandle_t | xQueueSet, |
| TickType_t | xTicksToWait ) |
Block until any member of the queue set receives an item, then return the handle of the member that fired.
After xQueueSelectFromSet() returns a non-NULL handle, the caller must call xQueueReceive() or xSemaphoreTake() on that handle to actually consume the item. The set only unblocks once per item deposited; if multiple items arrive before the caller drains them, xQueueSelectFromSet() will return the same member handle multiple times.
| xQueueSet | Handle of the queue set to wait on. |
| xTicksToWait | Maximum time to wait. portMAX_DELAY = wait forever, 0 = non-blocking poll. |
Definition at line 2199 of file freertos_stk.cpp.
References FrtosTimeoutToStk(), stk::sync::MessageQueue::Get(), IsIrqContext(), and FrtosQueueSet::m_token_mq.
| QueueSetMemberHandle_t xQueueSelectFromSetFromISR | ( | QueueSetHandle_t | xQueueSet | ) |
Non-blocking ISR-safe variant of xQueueSelectFromSet.
Returns immediately with the handle of a ready member, or NULL if no member currently has an item available.
| xQueueSet | Handle of the queue set to poll. |
Definition at line 2218 of file freertos_stk.cpp.
References FrtosQueueSet::m_token_mq, and stk::sync::MessageQueue::TryGet().
| BaseType_t xQueueSend | ( | QueueHandle_t | xQueue, |
| const void * | pvItemToQueue, | ||
| TickType_t | xTicksToWait ) |
Post an item to the back of a queue (blocking).
| xQueue | Handle of the target queue. |
| pvItemToQueue | Pointer to the item to copy into the queue. |
| xTicksToWait | Ticks to wait if full. portMAX_DELAY = wait forever. |
Definition at line 1727 of file freertos_stk.cpp.
References FrtosTimeoutToStk(), IsIrqContext(), FrtosQueue::m_mq, pdFAIL, pdPASS, stk::sync::MessageQueue::Put(), and QueueSetNotify().
Referenced by xQueueSendToBack().
| BaseType_t xQueueSendFromISR | ( | QueueHandle_t | xQueue, |
| const void * | pvItemToQueue, | ||
| BaseType_t * | pxHigherPriorityTaskWoken ) |
Post an item from ISR context (non-blocking).
| xQueue | Handle of the target queue. |
| pvItemToQueue | Pointer to the item to copy into the queue. |
| pxHigherPriorityTaskWoken | Set pdTRUE if a context switch is needed. |
Definition at line 1888 of file freertos_stk.cpp.
References FrtosQueue::m_mq, pdFAIL, pdFALSE, pdPASS, QueueSetNotify(), and stk::sync::MessageQueue::TryPut().
Referenced by xQueueSendToBackFromISR().
| BaseType_t xQueueSendToBack | ( | QueueHandle_t | xQueue, |
| const void * | pvItemToQueue, | ||
| TickType_t | xTicksToWait ) |
Post an item to the back of a queue (alias of xQueueSend).
| xQueue | Handle of the target queue. |
| pvItemToQueue | Pointer to the item to copy into the queue. |
| xTicksToWait | Ticks to wait if full. portMAX_DELAY = wait forever. |
Definition at line 1746 of file freertos_stk.cpp.
References xQueueSend().
| BaseType_t xQueueSendToBackFromISR | ( | QueueHandle_t | xQueue, |
| const void * | pvItemToQueue, | ||
| BaseType_t * | pxHigherPriorityTaskWoken ) |
Post an item to the back of a queue from ISR context (non-blocking). Equivalent to xQueueSendFromISR(); provided for source compatibility with code that explicitly names the insertion end.
| xQueue | Handle of the target queue. |
| pvItemToQueue | Pointer to the item to copy into the queue. |
| pxHigherPriorityTaskWoken | Set pdTRUE if a context switch is needed. |
Definition at line 1925 of file freertos_stk.cpp.
References xQueueSendFromISR().
| BaseType_t xQueueSendToFront | ( | QueueHandle_t | xQueue, |
| const void * | pvItemToQueue, | ||
| TickType_t | xTicksToWait ) |
Post an item to the front of a queue (blocking). The item becomes the next item returned by xQueueReceive().
| xQueue | Handle of the target queue. |
| pvItemToQueue | Pointer to the item to copy into the queue. |
| xTicksToWait | Ticks to wait if full. portMAX_DELAY = wait forever. |
Definition at line 1753 of file freertos_stk.cpp.
References FrtosTimeoutToStk(), IsIrqContext(), FrtosQueue::m_mq, pdFAIL, pdPASS, stk::sync::MessageQueue::PutFront(), and QueueSetNotify().
| BaseType_t xQueueSendToFrontFromISR | ( | QueueHandle_t | xQueue, |
| const void * | pvItemToQueue, | ||
| BaseType_t * | pxHigherPriorityTaskWoken ) |
Post an item to the front of a queue from ISR context (non-blocking).
The item becomes the next item returned by xQueueReceive() / xQueuePeek(). Backed by stk::sync::MessageQueue::TryPutFront() which retreats the tail pointer atomically under an internal critical section.
| xQueue | Handle of the target queue. |
| pvItemToQueue | Pointer to the item to copy into the queue. |
| pxHigherPriorityTaskWoken | Always set to pdFALSE; STK handles scheduling. |
Definition at line 1934 of file freertos_stk.cpp.
References FrtosQueue::m_mq, pdFAIL, pdFALSE, pdPASS, QueueSetNotify(), and stk::sync::MessageQueue::TryPutFront().
| SemaphoreHandle_t xSemaphoreCreateBinary | ( | void | ) |
Create a binary semaphore (initial count = 0, max = 1).
Definition at line 2239 of file freertos_stk.cpp.
References Counting, FrtosSemaphore::m_sem, ObjAlloc(), and ObjFree().
| SemaphoreHandle_t xSemaphoreCreateBinaryStatic | ( | StaticSemaphore_t * | pxSemaphoreBuffer | ) |
Create a binary semaphore using caller-supplied storage — no heap allocation.
| pxSemaphoreBuffer | Caller-allocated control block (StaticSemaphore_t). Must remain valid for the lifetime of the semaphore. |
Definition at line 2255 of file freertos_stk.cpp.
References Counting, FrtosSemaphore::m_cb_owned, FrtosSemaphore::m_sem, and FrtosSemaphore::~FrtosSemaphore().
| SemaphoreHandle_t xSemaphoreCreateCounting | ( | UBaseType_t | uxMaxCount, |
| UBaseType_t | uxInitialCount ) |
Create a counting semaphore.
| uxMaxCount | Maximum count value. |
| uxInitialCount | Initial count value (must be <= uxMaxCount). |
Definition at line 2287 of file freertos_stk.cpp.
References stk::sync::Semaphore::COUNT_MAX, Counting, FrtosSemaphore::m_sem, ObjAlloc(), and ObjFree().
| SemaphoreHandle_t xSemaphoreCreateCountingStatic | ( | UBaseType_t | uxMaxCount, |
| UBaseType_t | uxInitialCount, | ||
| StaticSemaphore_t * | pxSemaphoreBuffer ) |
Create a counting semaphore using caller-supplied storage — no heap allocation.
| uxMaxCount | Maximum count value. |
| uxInitialCount | Initial count value (must be <= uxMaxCount). |
| pxSemaphoreBuffer | Caller-allocated control block (StaticSemaphore_t). Must remain valid for the lifetime of the semaphore. |
Definition at line 2309 of file freertos_stk.cpp.
References stk::sync::Semaphore::COUNT_MAX, Counting, FrtosSemaphore::m_cb_owned, FrtosSemaphore::m_sem, and FrtosSemaphore::~FrtosSemaphore().
| SemaphoreHandle_t xSemaphoreCreateMutex | ( | void | ) |
Create a mutex.
Definition at line 2345 of file freertos_stk.cpp.
References FrtosSemaphore::m_mtx, Mutex, ObjAlloc(), and ObjFree().
Referenced by xSemaphoreCreateRecursiveMutex().
| SemaphoreHandle_t xSemaphoreCreateMutexStatic | ( | StaticSemaphore_t * | pxMutexBuffer | ) |
Create a mutex using caller-supplied storage — no heap allocation.
| pxMutexBuffer | Caller-allocated control block (StaticSemaphore_t). Must remain valid for the lifetime of the mutex. |
Definition at line 2361 of file freertos_stk.cpp.
References FrtosSemaphore::m_cb_owned, FrtosSemaphore::m_mtx, Mutex, and FrtosSemaphore::~FrtosSemaphore().
Referenced by xSemaphoreCreateRecursiveMutexStatic().
| SemaphoreHandle_t xSemaphoreCreateRecursiveMutex | ( | void | ) |
Create a recursive mutex (same implementation as xSemaphoreCreateMutex).
Definition at line 2385 of file freertos_stk.cpp.
References xSemaphoreCreateMutex().
| SemaphoreHandle_t xSemaphoreCreateRecursiveMutexStatic | ( | StaticSemaphore_t * | pxMutexBuffer | ) |
Create a recursive mutex using caller-supplied storage — no heap allocation.
| pxMutexBuffer | Caller-allocated control block (StaticSemaphore_t). Must remain valid for the lifetime of the mutex. |
Definition at line 2391 of file freertos_stk.cpp.
References xSemaphoreCreateMutexStatic().
| TaskHandle_t xSemaphoreGetMutexHolder | ( | SemaphoreHandle_t | xMutex | ) |
Return the handle of the task that currently holds a mutex.
Reads the owner field of the underlying stk::sync::Mutex under a ScopedCriticalSection so the snapshot is consistent even if a concurrent Unlock() is in progress.
| xMutex | Handle of a mutex created by xSemaphoreCreateMutex() or xSemaphoreCreateRecursiveMutex(). Passing a counting or binary semaphore handle always returns NULL. |
Definition at line 2539 of file freertos_stk.cpp.
References stk::sync::Mutex::GetOwner(), FrtosSemaphore::m_kind, FrtosSemaphore::m_mtx, Mutex, and stk::TID_NONE.
Referenced by xQueueGetMutexHolder().
| TaskHandle_t xSemaphoreGetMutexHolderFromISR | ( | SemaphoreHandle_t | xMutex | ) |
Return the handle of the task that currently holds a mutex (ISR-safe).
Reads the owner field of the underlying stk::sync::Mutex with a single pointer-sized load, which is naturally atomic on all supported STK architectures (Cortex-M and equivalents). No additional critical section is acquired beyond what the caller already holds.
| xMutex | Handle of a mutex. Passing a non-mutex semaphore returns NULL. |
Definition at line 2573 of file freertos_stk.cpp.
References stk::sync::Mutex::GetOwner(), FrtosSemaphore::m_kind, FrtosSemaphore::m_mtx, Mutex, and stk::TID_NONE.
Referenced by xQueueGetMutexHolderFromISR().
| BaseType_t xSemaphoreGive | ( | SemaphoreHandle_t | xSemaphore | ) |
Give (release) a semaphore or mutex.
| xSemaphore | Handle of the semaphore or mutex to release. |
Definition at line 2461 of file freertos_stk.cpp.
References stk::sync::Semaphore::COUNT_MAX, stk::sync::Semaphore::GetCount(), FrtosSemaphore::m_kind, FrtosSemaphore::m_mtx, FrtosSemaphore::m_sem, Mutex, pdFAIL, pdPASS, QueueSetNotify(), stk::sync::Semaphore::Signal(), and stk::sync::Mutex::Unlock().
Referenced by xSemaphoreGiveRecursive().
| BaseType_t xSemaphoreGiveFromISR | ( | SemaphoreHandle_t | xSemaphore, |
| BaseType_t * | pxHigherPriorityTaskWoken ) |
Give a binary or counting semaphore from ISR context.
| xSemaphore | Handle of the semaphore to release. |
| pxHigherPriorityTaskWoken | Set pdTRUE if a context switch is needed. |
Definition at line 2496 of file freertos_stk.cpp.
References stk::sync::Semaphore::COUNT_MAX, stk::sync::Semaphore::GetCount(), FrtosSemaphore::m_kind, FrtosSemaphore::m_sem, Mutex, pdFAIL, pdFALSE, pdPASS, QueueSetNotify(), and stk::sync::Semaphore::Signal().
| BaseType_t xSemaphoreGiveRecursive | ( | SemaphoreHandle_t | xMutex | ) |
Give a recursive mutex.
| xMutex | Handle of the recursive mutex to release. |
Definition at line 2491 of file freertos_stk.cpp.
References xSemaphoreGive().
| BaseType_t xSemaphoreTake | ( | SemaphoreHandle_t | xSemaphore, |
| TickType_t | xTicksToWait ) |
Take (acquire) a semaphore or mutex (blocking).
| xSemaphore | Handle of the semaphore or mutex to acquire. |
| xTicksToWait | Ticks to wait. portMAX_DELAY = wait forever. |
Definition at line 2407 of file freertos_stk.cpp.
References FrtosTimeoutToStk(), IsIrqContext(), FrtosSemaphore::m_kind, FrtosSemaphore::m_mtx, FrtosSemaphore::m_sem, Mutex, pdFAIL, pdPASS, stk::sync::Mutex::TimedLock(), and stk::sync::Semaphore::Wait().
Referenced by xSemaphoreTakeRecursive().
| BaseType_t xSemaphoreTakeFromISR | ( | SemaphoreHandle_t | xSemaphore, |
| BaseType_t * | pxHigherPriorityTaskWoken ) |
Take (acquire) a binary or counting semaphore from ISR context (non-blocking).
| xSemaphore | Handle of the semaphore to acquire. |
| pxHigherPriorityTaskWoken | Set pdTRUE if a context switch is needed. |
Definition at line 2430 of file freertos_stk.cpp.
References FrtosSemaphore::m_kind, FrtosSemaphore::m_sem, Mutex, pdFAIL, pdFALSE, pdPASS, and stk::sync::Semaphore::TryWait().
| BaseType_t xSemaphoreTakeRecursive | ( | SemaphoreHandle_t | xMutex, |
| TickType_t | xTicksToWait ) |
Take a recursive mutex (blocking).
| xMutex | Handle of the recursive mutex to acquire. |
| xTicksToWait | Ticks to wait. portMAX_DELAY = wait forever. |
Definition at line 2455 of file freertos_stk.cpp.
References xSemaphoreTake().
| size_t xStreamBufferBytesAvailable | ( | StreamBufferHandle_t | xStreamBuffer | ) |
Return the number of bytes currently available to read.
| xStreamBuffer | Handle of the stream buffer to query. |
Definition at line 3899 of file freertos_stk.cpp.
Referenced by xStreamBufferIsEmpty(), and xStreamBufferNextMessageLengthBytes().
| StreamBufferHandle_t xStreamBufferCreate | ( | size_t | xBufferSizeBytes, |
| size_t | xTriggerLevelBytes ) |
Create a dynamically allocated stream buffer.
| xBufferSizeBytes | Total byte capacity of the ring buffer. |
| xTriggerLevelBytes | Minimum bytes that must be present before a blocking Receive() wakes (1 = wake on any byte). |
Definition at line 3727 of file freertos_stk.cpp.
References FrtosStreamBuffer::m_buf_owned, FrtosStreamBuffer::m_cb_owned, ObjAlloc(), ObjAllocArray(), and ObjFreeArray().
| StreamBufferHandle_t xStreamBufferCreateStatic | ( | size_t | xBufferSizeBytes, |
| size_t | xTriggerLevelBytes, | ||
| uint8_t * | pucStreamBufferStorageArea, | ||
| StaticStreamBuffer_t * | pxStaticStreamBuffer ) |
Create a statically allocated stream buffer (no heap).
| xBufferSizeBytes | Total byte capacity. |
| xTriggerLevelBytes | Minimum bytes for Receive() to unblock. |
| pucStreamBufferStorageArea | Caller-supplied data buffer of at least xBufferSizeBytes bytes. |
| pxStaticStreamBuffer | Caller-supplied TCB (StaticStreamBuffer_t). |
Definition at line 3750 of file freertos_stk.cpp.
| StreamBufferHandle_t xStreamBufferCreateStaticWithCallback | ( | size_t | xBufferSizeBytes, |
| size_t | xTriggerLevelBytes, | ||
| uint8_t * | pucStreamBufferStorageArea, | ||
| StaticStreamBuffer_t * | pxStaticStreamBuffer, | ||
| StreamBufferCallbackFunction_t | pxSendCompletedCallback, | ||
| StreamBufferCallbackFunction_t | pxReceiveCompletedCallback ) |
Create a statically-allocated stream buffer with optional send/receive callbacks.
Identical to xStreamBufferCreateStatic() but registers per-instance callbacks. Either callback may be NULL.
| xBufferSizeBytes | Capacity of the data buffer in bytes. |
| xTriggerLevelBytes | Minimum bytes before Receive() unblocks. |
| pucStreamBufferStorageArea | Caller-supplied data buffer (>= xBufferSizeBytes bytes). |
| pxStaticStreamBuffer | Caller-supplied TCB (StaticStreamBuffer_t). |
| pxSendCompletedCallback | Called after bytes are written (or NULL). |
| pxReceiveCompletedCallback | Called after bytes are read (or NULL). |
Definition at line 4039 of file freertos_stk.cpp.
| StreamBufferHandle_t xStreamBufferCreateWithCallback | ( | size_t | xBufferSizeBytes, |
| size_t | xTriggerLevelBytes, | ||
| StreamBufferCallbackFunction_t | pxSendCompletedCallback, | ||
| StreamBufferCallbackFunction_t | pxReceiveCompletedCallback ) |
Create a heap-allocated stream buffer with optional send/receive callbacks.
Identical to xStreamBufferCreate() but registers per-instance callbacks invoked after data is successfully written (pxSendCompletedCallback) or read (pxReceiveCompletedCallback). Either callback may be NULL. Callbacks fire outside any critical section, after the transfer completes.
| xBufferSizeBytes | Capacity of the data buffer in bytes. |
| xTriggerLevelBytes | Minimum bytes before Receive() unblocks. |
| pxSendCompletedCallback | Called after bytes are written (or NULL). |
| pxReceiveCompletedCallback | Called after bytes are read (or NULL). |
Definition at line 4007 of file freertos_stk.cpp.
References FrtosStreamBuffer::m_buf_owned, FrtosStreamBuffer::m_cb_owned, ObjAlloc(), ObjAllocArray(), and ObjFreeArray().
| size_t xStreamBufferGetTriggerLevel | ( | StreamBufferHandle_t | xStreamBuffer | ) |
Return the trigger level currently set on a stream buffer.
| xStreamBuffer | Handle returned by xStreamBufferCreate[Static][WithCallback](). |
Definition at line 3965 of file freertos_stk.cpp.
| BaseType_t xStreamBufferIsEmpty | ( | StreamBufferHandle_t | xStreamBuffer | ) |
Return pdTRUE if the stream buffer contains no data.
| xStreamBuffer | Handle of the stream buffer to query. |
Definition at line 3915 of file freertos_stk.cpp.
References pdFALSE, pdTRUE, and xStreamBufferBytesAvailable().
| BaseType_t xStreamBufferIsFull | ( | StreamBufferHandle_t | xStreamBuffer | ) |
Return pdTRUE if the stream buffer is full (no write space remaining).
| xStreamBuffer | Handle of the stream buffer to query. |
Definition at line 3920 of file freertos_stk.cpp.
References pdFALSE, pdTRUE, and xStreamBufferSpacesAvailable().
| size_t xStreamBufferNextMessageLengthBytes | ( | StreamBufferHandle_t | xStreamBuffer | ) |
Return the number of bytes available to read from a stream buffer without blocking.
For a stream buffer (pure unframed byte stream) this is equivalent to xStreamBufferBytesAvailable(): the entire readable span is the "next message" because stream buffers carry no length-prefix framing. The function is provided for source compatibility with code written against the FreeRTOS stream/message buffer API where both buffer kinds are used interchangeably.
| xStreamBuffer | Handle returned by xStreamBufferCreate[Static][WithCallback](). |
Definition at line 3991 of file freertos_stk.cpp.
References xStreamBufferBytesAvailable().
| size_t xStreamBufferReceive | ( | StreamBufferHandle_t | xStreamBuffer, |
| void * | pvRxData, | ||
| size_t | xBufferLengthBytes, | ||
| TickType_t | xTicksToWait ) |
Read bytes from the stream buffer, blocking until trigger level is reached.
| xStreamBuffer | Handle. |
| pvRxData | Destination buffer. |
| xBufferLengthBytes | Maximum bytes to read. |
| xTicksToWait | Ticks to block until at least trigger bytes are available. |
Definition at line 3836 of file freertos_stk.cpp.
References FrtosTimeoutToStk(), IsIrqContext(), FrtosStreamBuffer::m_pipe, FrtosStreamBuffer::m_recv_cb, FrtosStreamBuffer::m_trigger, pdFALSE, and stk::sync::Pipe::ReadBulkTriggered().
| size_t xStreamBufferReceiveFromISR | ( | StreamBufferHandle_t | xStreamBuffer, |
| void * | pvRxData, | ||
| size_t | xBufferLengthBytes, | ||
| BaseType_t * | pxHigherPriorityTaskWoken ) |
Read bytes from ISR context (non-blocking, NO_WAIT).
| xStreamBuffer | Handle of the stream buffer to read from. |
| pvRxData | Destination buffer. |
| xBufferLengthBytes | Maximum bytes to read. |
| pxHigherPriorityTaskWoken | Always set to pdFALSE. |
Definition at line 3871 of file freertos_stk.cpp.
References FrtosStreamBuffer::m_pipe, FrtosStreamBuffer::m_recv_cb, pdFALSE, and stk::sync::Pipe::TryReadBulk().
| BaseType_t xStreamBufferReset | ( | StreamBufferHandle_t | xStreamBuffer | ) |
Discard all data and reset the stream buffer to the empty state.
| xStreamBuffer | Handle of the stream buffer to reset. |
Definition at line 3925 of file freertos_stk.cpp.
| BaseType_t xStreamBufferResetFromISR | ( | StreamBufferHandle_t | xStreamBuffer, |
| BaseType_t * | pxHigherPriorityTaskWoken ) |
Reset a stream buffer to empty from ISR context.
Delegates to Pipe::Reset() which holds a ScopedCriticalSection internally. Data in the buffer is discarded; tasks blocked in xStreamBufferSend() that were waiting for space are woken.
| xStreamBuffer | Handle of the stream buffer to reset. |
| pxHigherPriorityTaskWoken | Always set to pdFALSE; STK handles scheduling. |
Definition at line 3951 of file freertos_stk.cpp.
| size_t xStreamBufferSend | ( | StreamBufferHandle_t | xStreamBuffer, |
| const void * | pvTxData, | ||
| size_t | xDataLengthBytes, | ||
| TickType_t | xTicksToWait ) |
Write bytes into the stream buffer.
| xStreamBuffer | Handle. |
| pvTxData | Pointer to source data. |
| xDataLengthBytes | Number of bytes to write. |
| xTicksToWait | Ticks to wait for space (0 = non-blocking). |
Definition at line 3783 of file freertos_stk.cpp.
References FrtosTimeoutToStk(), FrtosStreamBuffer::m_pipe, FrtosStreamBuffer::m_send_cb, pdFALSE, and stk::sync::Pipe::WriteBulk().
| size_t xStreamBufferSendFromISR | ( | StreamBufferHandle_t | xStreamBuffer, |
| const void * | pvTxData, | ||
| size_t | xDataLengthBytes, | ||
| BaseType_t * | pxHigherPriorityTaskWoken ) |
Write bytes from ISR context (non-blocking, NO_WAIT).
| xStreamBuffer | Handle of the stream buffer to write to. |
| pvTxData | Pointer to source data. |
| xDataLengthBytes | Number of bytes to write. |
| pxHigherPriorityTaskWoken | Always set to pdFALSE (STK handles scheduling). |
Definition at line 3808 of file freertos_stk.cpp.
References FrtosStreamBuffer::m_pipe, FrtosStreamBuffer::m_send_cb, pdFALSE, and stk::sync::Pipe::TryWriteBulk().
| BaseType_t xStreamBufferSetTriggerLevel | ( | StreamBufferHandle_t | xStreamBuffer, |
| size_t | xTriggerLevelBytes ) |
Change the trigger level for a stream buffer.
| xStreamBuffer | Handle of the stream buffer to modify. |
| xTriggerLevelBytes | New minimum bytes for Receive() to unblock (>= 1). |
Definition at line 3934 of file freertos_stk.cpp.
References stk::sync::Pipe::GetCapacity(), FrtosStreamBuffer::m_pipe, FrtosStreamBuffer::m_trigger, pdFALSE, and pdTRUE.
| size_t xStreamBufferSpacesAvailable | ( | StreamBufferHandle_t | xStreamBuffer | ) |
Return the number of free bytes available for writing.
| xStreamBuffer | Handle of the stream buffer to query. |
Definition at line 3907 of file freertos_stk.cpp.
Referenced by xStreamBufferIsFull().
| BaseType_t xTaskAbortDelay | ( | TaskHandle_t | xTask | ) |
Abort a delay that the target task is currently blocked in (vTaskDelay, vTaskDelayUntil, or any timed sync primitive wait). The task is made immediately runnable; its next Wait/Sleep will not be affected.
| xTask | Handle of the task whose delay is to be aborted. |
Definition at line 1276 of file freertos_stk.cpp.
References FrtosTask::m_state, pdFAIL, pdFALSE, pdPASS, FrtosTask::Ready, and stk::SleepCancel().
| BaseType_t xTaskCreate | ( | TaskFunction_t | pvTaskCode, |
| const char * | pcName, | ||
| uint32_t | usStackDepth, | ||
| void * | pvParameters, | ||
| UBaseType_t | uxPriority, | ||
| TaskHandle_t * | pxCreatedTask ) |
Create a new dynamic task.
| pvTaskCode | Task function pointer. |
| pcName | Descriptive name for debugging. |
| usStackDepth | Stack depth in Words (not bytes). |
| pvParameters | Argument passed to pvTaskCode. |
| uxPriority | Priority: 0 = lowest, configMAX_PRIORITIES-1 = highest. |
| pxCreatedTask | Optional: receives the handle of the created task. |
Definition at line 1125 of file freertos_stk.cpp.
References EnsureKernelInitialized(), FREERTOS_STK_DEFAULT_STACK_WORDS, FREERTOS_STK_MIN_STACK_WORDS, FrtosPrioToStkWeight(), g_StkKernel, FrtosTask::m_argument, FrtosTask::m_func, FrtosTask::m_name, FrtosTask::m_stack, FrtosTask::m_stack_owned, FrtosTask::m_stack_size, FrtosTask::m_weight, ObjAlloc(), ObjAllocArray(), ObjFree(), pdFAIL, and pdPASS.
Referenced by xTaskCreateRestricted().
| BaseType_t xTaskCreateRestricted | ( | const TaskParameters_restricted_t * | pxTaskDefinition, |
| TaskHandle_t * | pxCreatedTask ) |
Create a task with optional MPU region descriptors, allocating the TCB and stack from the heap (source-compatible with the FreeRTOS heap variant of xTaskCreateRestricted).
| pxTaskDefinition | Pointer to a TaskParameters_restricted_t descriptor. Must not be NULL. |
| pxCreatedTask | Optional: receives the handle of the created task. |
Definition at line 1526 of file freertos_stk.cpp.
References TaskParameters_restricted_t::pcName, pdFAIL, TaskParameters_restricted_t::pvParameters, TaskParameters_restricted_t::pvTaskCode, TaskParameters_restricted_t::usStackDepth, TaskParameters_restricted_t::uxPriority, and xTaskCreate().
| BaseType_t xTaskCreateRestrictedStatic | ( | const TaskParameters_restricted_t * | pxTaskDefinition, |
| TaskHandle_t * | pxCreatedTask ) |
Create a task with caller-supplied static memory and optional MPU region descriptors (source-compatible with xTaskCreateRestricted).
| pxTaskDefinition | Pointer to a TaskParameters_restricted_t descriptor. Must not be NULL. puxStackBuffer and pxTaskBuffer inside the struct must also be non-NULL. |
| pxCreatedTask | Optional: receives the handle of the created task. |
Definition at line 1494 of file freertos_stk.cpp.
References TaskParameters_restricted_t::pcName, pdFAIL, pdPASS, TaskParameters_restricted_t::puxStackBuffer, TaskParameters_restricted_t::pvParameters, TaskParameters_restricted_t::pvTaskCode, TaskParameters_restricted_t::pxTaskBuffer, TaskParameters_restricted_t::usStackDepth, TaskParameters_restricted_t::uxPriority, and xTaskCreateStatic().
| TaskHandle_t xTaskCreateStatic | ( | TaskFunction_t | pvTaskCode, |
| const char * | pcName, | ||
| uint32_t | ulStackDepth, | ||
| void * | pvParameters, | ||
| UBaseType_t | uxPriority, | ||
| StackType_t * | puxStackBuffer, | ||
| StaticTask_t * | pxTaskBuffer ) |
Create a task using caller-supplied stack and TCB memory (no heap allocation).
| pvTaskCode | Task function pointer. |
| pcName | Descriptive name for debugging. |
| ulStackDepth | Stack depth in Words (not bytes). Must be >= configMINIMAL_STACK_SIZE. |
| pvParameters | Argument passed to pvTaskCode. |
| uxPriority | Priority: 0 = lowest, configMAX_PRIORITIES-1 = highest. |
| puxStackBuffer | Caller-allocated stack buffer of ulStackDepth Words. Must remain valid for the lifetime of the task. |
| pxTaskBuffer | Caller-allocated TCB buffer (StaticTask_t). Must remain valid for the lifetime of the task. |
Definition at line 1172 of file freertos_stk.cpp.
References EnsureKernelInitialized(), FREERTOS_STK_MIN_STACK_WORDS, FrtosPrioToStkWeight(), g_StkKernel, FrtosTask::m_argument, FrtosTask::m_cb_owned, FrtosTask::m_func, FrtosTask::m_name, FrtosTask::m_stack, FrtosTask::m_stack_owned, FrtosTask::m_stack_size, and FrtosTask::m_weight.
Referenced by xTaskCreateRestrictedStatic().
| BaseType_t xTaskDelayUntil | ( | TickType_t * | pxPreviousWakeTime, |
| TickType_t | xTimeIncrement ) |
Delay until an absolute tick deadline (FreeRTOS 10.2+ name for vTaskDelayUntil). Updates *pxPreviousWakeTime on each call.
| pxPreviousWakeTime | In/out: tick count at the last wake point; updated on return. |
| xTimeIncrement | Period in ticks between successive wake points. |
Definition at line 1305 of file freertos_stk.cpp.
References IsIrqContext(), pdFALSE, pdTRUE, and stk::SleepUntil().
Referenced by vTaskDelayUntil().
| TaskHandle_t xTaskGetCurrentTaskHandle | ( | void | ) |
Return the handle of the currently executing task.
Definition at line 1365 of file freertos_stk.cpp.
References stk::GetTid(), and IsIrqContext().
Referenced by pvTaskGetThreadLocalStoragePointer(), ResolveNotifyTarget(), and vTaskSetThreadLocalStoragePointer().
| TaskHandle_t xTaskGetHandle | ( | const char * | pcNameToQuery | ) |
Look up a task handle by name string (O(n) scan).
| pcNameToQuery | Name string to search for (exact match). |
Definition at line 1373 of file freertos_stk.cpp.
References FREERTOS_STK_MAX_TASKS, FreertosStrcmp(), and g_StkKernel.
| BaseType_t xTaskGetSchedulerState | ( | void | ) |
Return the current state of the FreeRTOS/STK scheduler.
< Scheduler is running normally (STATE_RUNNING).
< Scheduler is suspended via vTaskSuspendAll() (STATE_SUSPENDED).
< Scheduler has not yet been started (STATE_INACTIVE / STATE_READY).
Definition at line 1107 of file freertos_stk.cpp.
References g_StkKernel, stk::IKernel::KSTATE_RUNNING, stk::IKernel::KSTATE_SUSPENDED, taskSCHEDULER_NOT_STARTED, taskSCHEDULER_RUNNING, and taskSCHEDULER_SUSPENDED.
| TickType_t xTaskGetTickCount | ( | void | ) |
Return the tick count since the scheduler started.
Definition at line 1091 of file freertos_stk.cpp.
References stk::GetTicks().
| TickType_t xTaskGetTickCountFromISR | ( | void | ) |
Return the tick count from ISR context (ISR-safe).
Definition at line 1096 of file freertos_stk.cpp.
References stk::GetTicks().
| BaseType_t xTaskNotify | ( | TaskHandle_t | xTaskToNotify, |
| uint32_t | ulValue, | ||
| eNotifyAction | eAction ) |
Send a notification to a task (slot 0) with a specific action on its value.
| xTaskToNotify | Handle of the task to notify (must not be NULL). |
| ulValue | Value applied according to eAction. |
| eAction | How ulValue is applied to the task's notification value. |
Definition at line 3405 of file freertos_stk.cpp.
References xTaskNotifyIndexed().
| BaseType_t xTaskNotifyAndQuery | ( | TaskHandle_t | xTaskToNotify, |
| uint32_t | ulValue, | ||
| eNotifyAction | eAction, | ||
| uint32_t * | pulPreviousNotifyValue ) |
Send a notification to a task (slot 0) and return the previous notification value before the action was applied.
| xTaskToNotify | Target task handle (must not be NULL). |
| ulValue | Value applied according to eAction. |
| eAction | How ulValue is applied to the notification value. |
| pulPreviousNotifyValue | Receives the slot value before the action is applied. May be NULL. |
Definition at line 3493 of file freertos_stk.cpp.
References xTaskNotifyAndQueryIndexed().
| BaseType_t xTaskNotifyAndQueryFromISR | ( | TaskHandle_t | xTaskToNotify, |
| uint32_t | ulValue, | ||
| eNotifyAction | eAction, | ||
| uint32_t * | pulPreviousNotifyValue, | ||
| BaseType_t * | pxHigherPriorityTaskWoken ) |
ISR-safe variant of xTaskNotifyAndQuery (slot 0).
| xTaskToNotify | Target task handle (must not be NULL). |
| ulValue | Value applied according to eAction. |
| eAction | How ulValue is applied to the task's notification value. |
| pulPreviousNotifyValue | Receives the slot value before the action is applied. May be NULL. |
| pxHigherPriorityTaskWoken | Always set to pdFALSE (STK handles wake internally). |
Definition at line 3527 of file freertos_stk.cpp.
References xTaskNotifyAndQueryFromISRIndexed().
| BaseType_t xTaskNotifyAndQueryFromISRIndexed | ( | TaskHandle_t | xTaskToNotify, |
| UBaseType_t | uxIndexToNotify, | ||
| uint32_t | ulValue, | ||
| eNotifyAction | eAction, | ||
| uint32_t * | pulPreviousNotifyValue, | ||
| BaseType_t * | pxHigherPriorityTaskWoken ) |
ISR-safe indexed variant of xTaskNotifyAndQuery.
| xTaskToNotify | Target task handle (must not be NULL). |
| uxIndexToNotify | Notification slot index (0 .. configTASK_NOTIFICATION_ARRAY_ENTRIES-1). |
| ulValue | Value applied according to eAction. |
| eAction | How ulValue is applied to the slot's notification value. |
| pulPreviousNotifyValue | Receives the slot value before the action is applied. May be NULL. |
| pxHigherPriorityTaskWoken | Always set to pdFALSE. |
Definition at line 3506 of file freertos_stk.cpp.
References pdFALSE, and xTaskNotifyAndQueryIndexed().
Referenced by xTaskNotifyAndQueryFromISR().
| BaseType_t xTaskNotifyAndQueryIndexed | ( | TaskHandle_t | xTaskToNotify, |
| UBaseType_t | uxIndexToNotify, | ||
| uint32_t | ulValue, | ||
| eNotifyAction | eAction, | ||
| uint32_t * | pulPreviousNotifyValue ) |
Indexed variant of xTaskNotifyAndQuery.
| xTaskToNotify | Target task handle (must not be NULL). |
| uxIndexToNotify | Notification slot index (0 .. configTASK_NOTIFICATION_ARRAY_ENTRIES-1). |
| ulValue | Value applied according to eAction. |
| eAction | How ulValue is applied to the slot's notification value. |
| pulPreviousNotifyValue | Receives the slot value before the action is applied. May be NULL. |
Definition at line 3459 of file freertos_stk.cpp.
References FrtosTask::m_notify, NotifyApplyAction(), pdFAIL, pdPASS, ResolveNotifyTarget(), FrtosTask::NotifySlot::sem, stk::sync::Semaphore::Signal(), and FrtosTask::NotifySlot::value.
Referenced by xTaskNotifyAndQuery(), and xTaskNotifyAndQueryFromISRIndexed().
| BaseType_t xTaskNotifyFromISR | ( | TaskHandle_t | xTaskToNotify, |
| uint32_t | ulValue, | ||
| eNotifyAction | eAction, | ||
| BaseType_t * | pxHigherPriorityTaskWoken ) |
Send a notification (slot 0) from ISR context.
| xTaskToNotify | Handle of the task to notify (must not be NULL). |
| ulValue | Value applied according to eAction. |
| eAction | How ulValue is applied to the task's notification value. |
| pxHigherPriorityTaskWoken | Set pdTRUE if a context switch is needed (always pdFALSE in STK wrapper). |
Definition at line 3421 of file freertos_stk.cpp.
References xTaskNotifyFromISRIndexed().
| BaseType_t xTaskNotifyFromISRIndexed | ( | TaskHandle_t | xTaskToNotify, |
| UBaseType_t | uxIndexToNotify, | ||
| uint32_t | ulValue, | ||
| eNotifyAction | eAction, | ||
| BaseType_t * | pxHigherPriorityTaskWoken ) |
Send a notification to a specific slot from ISR context.
| xTaskToNotify | Handle of the task to notify (must not be NULL). |
| uxIndexToNotify | Notification slot index (0 .. configTASK_NOTIFICATION_ARRAY_ENTRIES-1). |
| ulValue | Value applied according to eAction. |
| eAction | How ulValue is applied to the slot's notification value. |
| pxHigherPriorityTaskWoken | Always set to pdFALSE (STK handles wake internally). |
Definition at line 3377 of file freertos_stk.cpp.
References pdFALSE, and xTaskNotifyIndexed().
Referenced by xTaskNotifyFromISR().
| BaseType_t xTaskNotifyGive | ( | TaskHandle_t | xTaskToNotify | ) |
Send a notification to a task (slot 0), incrementing its notification value by 1. Equivalent to xTaskNotify(xTaskToNotify, 0, eIncrement).
| xTaskToNotify | Handle of the task to notify (must not be NULL). |
Definition at line 3395 of file freertos_stk.cpp.
References xTaskNotifyGiveIndexed().
| BaseType_t xTaskNotifyGiveIndexed | ( | TaskHandle_t | xTaskToNotify, |
| UBaseType_t | uxIndexToNotify ) |
Send a notification to a specific slot of a task, incrementing the slot's value by 1.
| xTaskToNotify | Handle of the task to notify (must not be NULL). |
| uxIndexToNotify | Notification slot index (0 .. configTASK_NOTIFICATION_ARRAY_ENTRIES-1). |
Definition at line 3272 of file freertos_stk.cpp.
References FrtosTask::m_notify, pdFAIL, pdPASS, ResolveNotifyTarget(), FrtosTask::NotifySlot::sem, and stk::sync::Semaphore::Signal().
Referenced by xTaskNotifyGive().
| BaseType_t xTaskNotifyIndexed | ( | TaskHandle_t | xTaskToNotify, |
| UBaseType_t | uxIndexToNotify, | ||
| uint32_t | ulValue, | ||
| eNotifyAction | eAction ) |
Send a notification to a specific slot of a task with a chosen action.
| xTaskToNotify | Handle of the task to notify (must not be NULL). |
| uxIndexToNotify | Notification slot index (0 .. configTASK_NOTIFICATION_ARRAY_ENTRIES-1). |
| ulValue | Value applied according to eAction. |
| eAction | How ulValue is applied to the slot's value. |
Definition at line 3315 of file freertos_stk.cpp.
References FrtosTask::m_notify, NotifyApplyAction(), pdFAIL, pdPASS, ResolveNotifyTarget(), FrtosTask::NotifySlot::sem, and stk::sync::Semaphore::Signal().
Referenced by xTaskNotify(), and xTaskNotifyFromISRIndexed().
| BaseType_t xTaskNotifyStateClear | ( | TaskHandle_t | xTask | ) |
Clear the pending notification state for slot 0 of a task.
If a notification was pending (i.e. the task had been notified but had not yet called xTaskNotifyWait() or ulTaskNotifyTake() to consume it), this function clears the pending state and returns pdTRUE. If no notification was pending it returns pdFALSE.
| xTask | Handle of the task whose notification state is to be cleared. NULL selects the calling task. |
Definition at line 3596 of file freertos_stk.cpp.
References xTaskNotifyStateClearIndexed().
| BaseType_t xTaskNotifyStateClearIndexed | ( | TaskHandle_t | xTask, |
| UBaseType_t | uxIndexToClear ) |
Indexed variant of xTaskNotifyStateClear.
| xTask | Handle of the task. NULL selects the calling task. |
| uxIndexToClear | Notification slot index (0 .. configTASK_NOTIFICATION_ARRAY_ENTRIES-1). |
Definition at line 3561 of file freertos_stk.cpp.
References stk::sync::Semaphore::GetCount(), FrtosTask::m_notify, pdFALSE, pdTRUE, FrtosTask::NotifySlot::pending, ResolveNotifyTarget(), FrtosTask::NotifySlot::sem, and stk::sync::Semaphore::TryWait().
Referenced by xTaskNotifyStateClear().
| BaseType_t xTaskNotifyWait | ( | uint32_t | ulBitsToClearOnEntry, |
| uint32_t | ulBitsToClearOnExit, | ||
| uint32_t * | pulNotificationValue, | ||
| TickType_t | xTicksToWait ) |
Wait for a notification (slot 0), with optional bit-masking on entry and exit.
| ulBitsToClearOnEntry | Bits cleared before blocking. |
| ulBitsToClearOnExit | Bits cleared before returning. |
| pulNotificationValue | Receives the value before the exit-clear (may be NULL). |
| xTicksToWait | Ticks to wait. |
Definition at line 3412 of file freertos_stk.cpp.
References xTaskNotifyWaitIndexed().
| BaseType_t xTaskNotifyWaitIndexed | ( | UBaseType_t | uxIndexToWait, |
| uint32_t | ulBitsToClearOnEntry, | ||
| uint32_t | ulBitsToClearOnExit, | ||
| uint32_t * | pulNotificationValue, | ||
| TickType_t | xTicksToWait ) |
Wait for a notification on a specific slot of the calling task.
| uxIndexToWait | Notification slot index. |
| ulBitsToClearOnEntry | Bits cleared in the slot value before blocking. |
| ulBitsToClearOnExit | Bits cleared in the slot value before returning. |
| pulNotificationValue | Receives the slot value before the exit-clear (may be NULL). |
| xTicksToWait | Ticks to wait. |
Definition at line 3338 of file freertos_stk.cpp.
References FrtosTimeoutToStk(), IsIrqContext(), FrtosTask::m_notify, pdFAIL, pdPASS, FrtosTask::NotifySlot::pending, ResolveNotifyTarget(), FrtosTask::NotifySlot::sem, FrtosTask::NotifySlot::value, and stk::sync::Semaphore::Wait().
Referenced by xTaskNotifyWait().
| BaseType_t xTaskResumeAll | ( | void | ) |
Resume a previously suspended scheduler.
Definition at line 1085 of file freertos_stk.cpp.
References stk::hw::CriticalSection::Exit(), and pdFALSE.
| BaseType_t xTaskResumeFromISR | ( | TaskHandle_t | xTaskToResume | ) |
Resume a previously suspended task from ISR context.
| xTaskToResume | Handle of the task to resume. |
Definition at line 1258 of file freertos_stk.cpp.
References g_StkKernel, FrtosTask::m_state, pdFALSE, pdTRUE, FrtosTask::Ready, and FrtosTask::Suspended.
| BaseType_t xTimerChangePeriod | ( | TimerHandle_t | xTimer, |
| TickType_t | xNewPeriod, | ||
| TickType_t | xTicksToWait ) |
Change the period of a timer and restart it immediately.
| xTimer | Handle of the timer to modify. |
| xNewPeriod | New timer period in ticks (must be > 0). |
| xTicksToWait | Accepted for API compatibility; ignored (command queue write is non-blocking). |
Definition at line 2706 of file freertos_stk.cpp.
References FrtosTimer::m_period, pdFAIL, and xTimerStart().
| BaseType_t xTimerChangePeriodFromISR | ( | TimerHandle_t | xTimer, |
| TickType_t | xNewPeriod, | ||
| BaseType_t * | pxHigherPriorityTaskWoken ) |
Change the period of a timer and restart it from ISR context.
| xTimer | Handle of the timer to modify. |
| xNewPeriod | New timer period in ticks (must be > 0). |
| pxHigherPriorityTaskWoken | Always set to pdFALSE. |
Definition at line 2780 of file freertos_stk.cpp.
References g_TimerHost, FrtosTimer::m_auto_reload, FrtosTimer::m_period, pdFAIL, pdFALSE, and pdPASS.
| TimerHandle_t xTimerCreate | ( | const char * | pcTimerName, |
| TickType_t | xTimerPeriodInTicks, | ||
| UBaseType_t | uxAutoReload, | ||
| void * | pvTimerID, | ||
| TimerCallbackFunction_t | pxCallbackFunction ) |
Create a software timer.
| pcTimerName | Name for debugging. |
| xTimerPeriodInTicks | Period in ticks (must be > 0). |
| uxAutoReload | pdTRUE = periodic, pdFALSE = one-shot. |
| pvTimerID | Application-defined value stored in the timer. |
| pxCallbackFunction | Callback invoked on expiry. |
Definition at line 2604 of file freertos_stk.cpp.
References FrtosTimer::EnsureTimerHost(), IsIrqContext(), ObjAlloc(), and pdTRUE.
| TimerHandle_t xTimerCreateStatic | ( | const char * | pcTimerName, |
| TickType_t | xTimerPeriodInTicks, | ||
| UBaseType_t | uxAutoReload, | ||
| void * | pvTimerID, | ||
| TimerCallbackFunction_t | pxCallbackFunction, | ||
| StaticTimer_t * | pxTimerBuffer ) |
Create a software timer using caller-supplied storage — no heap allocation.
| pcTimerName | Name for debugging. |
| xTimerPeriodInTicks | Period in ticks (must be > 0). |
| uxAutoReload | pdTRUE = periodic, pdFALSE = one-shot. |
| pvTimerID | Application-defined value stored in the timer. |
| pxCallbackFunction | Callback invoked on expiry. |
| pxTimerBuffer | Caller-allocated control block (StaticTimer_t). Must remain valid for the lifetime of the timer. |
Definition at line 2626 of file freertos_stk.cpp.
References FrtosTimer::EnsureTimerHost(), IsIrqContext(), FrtosTimer::m_cb_owned, and pdTRUE.
| BaseType_t xTimerDelete | ( | TimerHandle_t | xTimer, |
| TickType_t | xTicksToWait ) |
Delete a software timer and free its memory.
| xTimer | Handle of the timer to delete. |
| xTicksToWait | Accepted for API compatibility; ignored (command queue write is non-blocking). |
Definition at line 2659 of file freertos_stk.cpp.
References g_TimerHost, stk::time::TimerHost::Timer::IsActive(), ObjFree(), pdFAIL, and pdPASS.
| TickType_t xTimerGetExpiryTime | ( | TimerHandle_t | xTimer | ) |
Return the absolute tick count at which the timer will next expire. Returns 0 if the timer is not currently running.
| xTimer | Handle of the timer to query. |
Definition at line 2934 of file freertos_stk.cpp.
References g_TimerHost, stk::time::TimerHost::Timer::GetDeadline(), and stk::time::TimerHost::Timer::IsActive().
| TickType_t xTimerGetPeriod | ( | TimerHandle_t | xTimer | ) |
Return the period of a timer in ticks.
| xTimer | Handle of the timer to query. |
Definition at line 2926 of file freertos_stk.cpp.
| BaseType_t xTimerIsTimerActive | ( | TimerHandle_t | xTimer | ) |
Query whether a timer is currently active (running).
| xTimer | Handle of the timer to query. |
Definition at line 2894 of file freertos_stk.cpp.
| BaseType_t xTimerPendFunctionCall | ( | PendedFunction_t | xFunctionToPend, |
| void * | pvParameter1, | ||
| uint32_t | ulParameter2, | ||
| TickType_t | xTicksToWait ) |
Defer execution of a function to the timer-task context (task-context variant).
Writes a PendCall record {xFunctionToPend, pvParameter1, ulParameter2} into the static g_PendCallPipe (PipeT<PendCall, FREERTOS_STK_PEND_CALL_QUEUE_SIZE>). The TimerHost handler task drains the pipe on each wake cycle and invokes every callback directly — no heap allocation is performed, no self-deleting timer object is created.
| xFunctionToPend | Callback to invoke in the timer-task context. Signature: void cb(void *pvParam1, uint32_t ulParam2). |
| pvParameter1 | First argument forwarded to the callback. |
| ulParameter2 | Second argument forwarded to the callback. |
| xTicksToWait | Ticks to wait if the pipe is full. portMAX_DELAY blocks indefinitely. |
Definition at line 2835 of file freertos_stk.cpp.
References EnsurePendDrainer(), FrtosTimer::EnsureTimerHost(), FrtosTimeoutToStk(), g_PendCallPipe, IsIrqContext(), pdFAIL, and pdPASS.
| BaseType_t xTimerPendFunctionCallFromISR | ( | PendedFunction_t | xFunctionToPend, |
| void * | pvParameter1, | ||
| uint32_t | ulParameter2, | ||
| BaseType_t * | pxHigherPriorityTaskWoken ) |
Defer execution of a function to the timer-task context (ISR-safe variant).
Identical in effect to xTimerPendFunctionCall() but safe to call from an interrupt service routine. The call record is written into a static PipeT<PendCall, FREERTOS_STK_PEND_CALL_QUEUE_SIZE> with NO_WAIT semantics — no heap allocation is performed. If the pipe is full the function returns pdFAIL immediately.
| xFunctionToPend | Callback to invoke in the timer-task context. |
| pvParameter1 | First argument forwarded to the callback. |
| ulParameter2 | Second argument forwarded to the callback. |
| pxHigherPriorityTaskWoken | Always set to pdFALSE (STK wakes the timer task internally; no manual yield required). |
Definition at line 2865 of file freertos_stk.cpp.
References g_PendCallPipe, g_TimerHost, KickPendDrainerFromISR(), pdFAIL, pdFALSE, and pdPASS.
| BaseType_t xTimerReset | ( | TimerHandle_t | xTimer, |
| TickType_t | xTicksToWait ) |
Reset a timer (restart its period from the current tick).
| xTimer | Handle of the timer to reset. |
| xTicksToWait | Accepted for API compatibility; ignored (command queue write is non-blocking). |
Definition at line 2701 of file freertos_stk.cpp.
References xTimerStart().
| BaseType_t xTimerResetFromISR | ( | TimerHandle_t | xTimer, |
| BaseType_t * | pxHigherPriorityTaskWoken ) |
Reset (restart the period of) a timer from ISR context.
| xTimer | Handle of the timer to reset. |
| pxHigherPriorityTaskWoken | Always set to pdFALSE. |
Definition at line 2773 of file freertos_stk.cpp.
References xTimerStartFromISR().
| BaseType_t xTimerStart | ( | TimerHandle_t | xTimer, |
| TickType_t | xTicksToWait ) |
Start (or restart) a timer from the current tick.
| xTimer | Handle of the timer to start. |
| xTicksToWait | Accepted for API compatibility; ignored (command queue write is non-blocking). |
Definition at line 2673 of file freertos_stk.cpp.
References g_TimerHost, IsIrqContext(), FrtosTimer::m_auto_reload, FrtosTimer::m_period, pdFAIL, and pdPASS.
Referenced by xTimerChangePeriod(), and xTimerReset().
| BaseType_t xTimerStartFromISR | ( | TimerHandle_t | xTimer, |
| BaseType_t * | pxHigherPriorityTaskWoken ) |
Start (or restart) a timer from ISR context.
| xTimer | Handle of the timer to start. |
| pxHigherPriorityTaskWoken | Always set to pdFALSE. |
Definition at line 2740 of file freertos_stk.cpp.
References g_TimerHost, FrtosTimer::m_auto_reload, FrtosTimer::m_period, pdFAIL, pdFALSE, and pdPASS.
Referenced by xTimerResetFromISR().
| BaseType_t xTimerStop | ( | TimerHandle_t | xTimer, |
| TickType_t | xTicksToWait ) |
Stop a running timer.
| xTimer | Handle of the timer to stop. |
| xTicksToWait | Accepted for API compatibility; ignored (command queue write is non-blocking). |
Definition at line 2688 of file freertos_stk.cpp.
References g_TimerHost, stk::time::TimerHost::Timer::IsActive(), IsIrqContext(), pdFAIL, and pdPASS.
| BaseType_t xTimerStopFromISR | ( | TimerHandle_t | xTimer, |
| BaseType_t * | pxHigherPriorityTaskWoken ) |
Stop a running timer from ISR context.
| xTimer | Handle of the timer to stop. |
| pxHigherPriorityTaskWoken | Always set to pdFALSE. |
Definition at line 2756 of file freertos_stk.cpp.
References g_TimerHost, stk::time::TimerHost::Timer::IsActive(), pdFAIL, pdFALSE, and pdPASS.