|
SuperTinyKernel™ RTOS 1.08.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 configNUM_THREAD_LOCAL_STORAGE_POINTERS 4U |
Per-task TLS pointer slots.
Definition at line 168 of file FreeRTOS.h.
Referenced by pvTaskGetThreadLocalStoragePointer(), and vTaskSetThreadLocalStoragePointer().
| #define configSTACK_DEPTH_TYPE StackType_t |
Stack depth word type.
Definition at line 278 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 172 of file FreeRTOS.h.
| #define configTICK_RATE_HZ 1000U |
Definition at line 164 of file FreeRTOS.h.
| #define configUSE_COUNTING_SEMAPHORES 1U |
Include counting semaphore API.
Definition at line 196 of file FreeRTOS.h.
| #define configUSE_EVENT_GROUPS 1U |
Include event group API.
Definition at line 188 of file FreeRTOS.h.
| #define configUSE_MUTEXES 1U |
Include mutex and recursive-mutex API.
Definition at line 180 of file FreeRTOS.h.
| #define configUSE_QUEUE_SETS 1U |
Include queue sets API.
Definition at line 176 of file FreeRTOS.h.
| #define configUSE_STREAM_BUFFERS 1U |
Include stream buffer and message buffer API.
Definition at line 192 of file FreeRTOS.h.
| #define configUSE_TASK_NOTIFICATIONS 1U |
Include task notification API (xTaskNotify etc.).
Definition at line 200 of file FreeRTOS.h.
| #define configUSE_TIMERS 1U |
Include software timer API.
Definition at line 184 of file FreeRTOS.h.
| #define errQUEUE_EMPTY ((BaseType_t)0) |
Definition at line 274 of file FreeRTOS.h.
| #define errQUEUE_FULL ((BaseType_t)0) |
Definition at line 275 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 219 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 212 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 242 of file FreeRTOS.h.
| #define pdFAIL (pdFALSE) |
Definition at line 273 of file FreeRTOS.h.
Referenced by xEventGroupSetBitsFromISR(), xMessageBufferReset(), xMessageBufferResetFromISR(), xQueueAddToSet(), xQueueOverwrite(), xQueueOverwriteFromISR(), xQueuePeek(), xQueuePeekFromISR(), xQueueReceive(), xQueueReceiveFromISR(), xQueueRemoveFromSet(), xQueueReset(), xQueueSend(), xQueueSendFromISR(), xQueueSendToFront(), xQueueSendToFrontFromISR(), xSemaphoreGive(), xSemaphoreGiveFromISR(), xSemaphoreGiveRecursive(), xSemaphoreTake(), xSemaphoreTakeFromISR(), xSemaphoreTakeRecursive(), 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 271 of file FreeRTOS.h.
Referenced by 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 | ) |
1 ms tick resolution.
Definition at line 2214 of file FreeRTOS.h.
Referenced by clock_task(), and signal_func().
| #define pdPASS (pdTRUE) |
Definition at line 272 of file FreeRTOS.h.
Referenced by 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(), xTimerDelete(), xTimerPendFunctionCall(), and xTimerPendFunctionCallFromISR().
| #define pdTRUE ((BaseType_t)1) |
Definition at line 270 of file FreeRTOS.h.
Referenced by ulTaskNotifyTakeIndexed(), xMessageBufferIsEmpty(), xMessageBufferIsFull(), xQueueIsQueueEmptyFromISR(), xQueueIsQueueFullFromISR(), xStreamBufferIsEmpty(), xStreamBufferIsFull(), xStreamBufferSetTriggerLevel(), xTaskDelayUntil(), xTaskNotifyStateClearIndexed(), xTaskResumeFromISR(), xTimerCreate(), xTimerCreateStatic(), and xTimerIsTimerActive().
| #define portNUM_CONFIGURABLE_REGIONS 3U |
MPU memory region descriptor used by xTaskCreateRestrictedStatic().
Definition at line 577 of file FreeRTOS.h.
| #define portYIELD | ( | ) |
Definition at line 415 of file FreeRTOS.h.
| #define STATIC_EVENT_GROUP_TCB_SIZE_WORDS 13U |
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 525 of file FreeRTOS.h.
| #define STATIC_MESSAGE_BUFFER_TCB_SIZE_WORDS 53U |
Opaque buffer type for xMessageBufferCreateStatic() and xMessageBufferCreateStaticWithCallback(). Covers FrtosMessageBuffer (BlockMemoryPool header + envelope MessageQueue header
Definition at line 547 of file FreeRTOS.h.
| #define STATIC_QUEUE_TCB_SIZE_WORDS 25U |
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 493 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 504 of file FreeRTOS.h.
| #define STATIC_STREAM_BUFFER_TCB_SIZE_WORDS 27U |
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 536 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 482 of file FreeRTOS.h.
| #define STATIC_TIMER_TCB_SIZE_WORDS 10U |
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 515 of file FreeRTOS.h.
| #define taskDISABLE_INTERRUPTS | ( | ) |
Definition at line 412 of file FreeRTOS.h.
| #define taskENABLE_INTERRUPTS | ( | ) |
Definition at line 413 of file FreeRTOS.h.
| #define taskENTER_CRITICAL | ( | ) |
Definition at line 410 of file FreeRTOS.h.
| #define taskEXIT_CRITICAL | ( | ) |
Definition at line 411 of file FreeRTOS.h.
| #define taskSCHEDULER_NOT_STARTED ((BaseType_t)0) |
Scheduler has not yet been started (STATE_INACTIVE / STATE_READY).
Definition at line 445 of file FreeRTOS.h.
Referenced by xTaskGetSchedulerState().
| #define taskSCHEDULER_RUNNING ((BaseType_t)1) |
Scheduler is running normally (STATE_RUNNING).
Definition at line 446 of file FreeRTOS.h.
Referenced by xTaskGetSchedulerState().
| #define taskSCHEDULER_SUSPENDED ((BaseType_t)2) |
Scheduler is suspended via vTaskSuspendAll() (STATE_SUSPENDED).
Definition at line 447 of file FreeRTOS.h.
Referenced by xTaskGetSchedulerState().
| #define taskYIELD | ( | ) |
Definition at line 414 of file FreeRTOS.h.
| #define tskIDLE_PRIORITY ((UBaseType_t)0U) |
Idle task priority.
Definition at line 2215 of file FreeRTOS.h.
| #define xTaskHandle TaskHandle_t |
Legacy handle alias.
Definition at line 2216 of file FreeRTOS.h.
| typedef long BaseType_t |
Definition at line 261 of file FreeRTOS.h.
| typedef uint32_t EventBits_t |
Bitmask for event group operations (bits 0..23 per FreeRTOS convention).
Definition at line 387 of file FreeRTOS.h.
| typedef void* EventGroupHandle_t |
Handle for an event group.
Definition at line 321 of file FreeRTOS.h.
| typedef void* MessageBufferHandle_t |
Handle for a message buffer.
Definition at line 323 of file FreeRTOS.h.
| typedef void(* PendedFunction_t) (void *pvParameter1, uint32_t ulParameter2) |
Callback for xTimerPendFunctionCall().
Definition at line 335 of file FreeRTOS.h.
| typedef long portBASE_TYPE |
Definition at line 263 of file FreeRTOS.h.
| typedef void* QueueHandle_t |
Handle for a queue.
Definition at line 318 of file FreeRTOS.h.
| typedef void* QueueSetHandle_t |
Definition at line 326 of file FreeRTOS.h.
| typedef void* QueueSetMemberHandle_t |
Definition at line 327 of file FreeRTOS.h.
| typedef void* SemaphoreHandle_t |
Handle for a semaphore/mutex.
Definition at line 319 of file FreeRTOS.h.
| typedef uintptr_t StackType_t |
Native-word stack element type, matches stk::Word.
Definition at line 264 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 343 of file FreeRTOS.h.
| typedef void* StreamBufferHandle_t |
Handle for a stream buffer.
Definition at line 322 of file FreeRTOS.h.
| typedef void(* TaskFunction_t) (void *pvParameters) |
Task entry function.
Definition at line 333 of file FreeRTOS.h.
| typedef void* TaskHandle_t |
| typedef uint32_t TickType_t |
Definition at line 260 of file FreeRTOS.h.
| typedef void(* TimerCallbackFunction_t) (TimerHandle_t xTimer) |
Timer expiry callback.
Definition at line 334 of file FreeRTOS.h.
| typedef void* TimerHandle_t |
Handle for a software timer.
Definition at line 320 of file FreeRTOS.h.
| typedef unsigned long UBaseType_t |
Definition at line 262 of file FreeRTOS.h.
| enum eNotifyAction |
Action applied to a task's notification value by xTaskNotify().
Definition at line 301 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 286 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 1678 of file freertos_stk.cpp.
References eDeleted, eInvalid, eReady, eRunning, eSuspended, and stk::GetTid().
| 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 1728 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 3312 of file freertos_stk.cpp.
| void * pvPortMalloc | ( | size_t | xWantedSize | ) |
Allocate xWantedSize bytes from the system heap.
malloc. Definition at line 1244 of file freertos_stk.cpp.
References __stk_weak, and stk::memory::MemoryAllocator::Allocate().
| 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 3959 of file freertos_stk.cpp.
References configNUM_THREAD_LOCAL_STORAGE_POINTERS, 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 3296 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 1333 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 3677 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 3551 of file freertos_stk.cpp.
References pdTRUE, stk::sync::SemaphoreT< T >::TrySignal(), and stk::sync::SemaphoreT< T >::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 3912 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 3890 of file freertos_stk.cpp.
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 2147 of file freertos_stk.cpp.
| 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 2156 of file freertos_stk.cpp.
| 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 2166 of file freertos_stk.cpp.
| 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 2902 of file freertos_stk.cpp.
References stk::TID_NONE.
| UBaseType_t uxTaskGetNumberOfTasks | ( | void | ) |
Return the number of tasks currently under kernel management.
Definition at line 1381 of file freertos_stk.cpp.
| 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 1736 of file freertos_stk.cpp.
References 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 1746 of file freertos_stk.cpp.
References configSTACK_DEPTH_TYPE, 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 1756 of file freertos_stk.cpp.
References configSTACK_DEPTH_TYPE, TaskStatus_t::eCurrentState, eDeleted, eReady, eRunning, eSuspended, FREERTOS_STK_MAX_TASKS, stk::GetTid(), TaskStatus_t::pcTaskName, TaskStatus_t::pxStackBase, 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 1663 of file freertos_stk.cpp.
References stk::GetTid().
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 1673 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 3372 of file freertos_stk.cpp.
| 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 4489 of file freertos_stk.cpp.
| 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 1323 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 1328 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 1249 of file freertos_stk.cpp.
References __stk_weak, and stk::memory::MemoryAllocator::Free().
| 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 1294 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::GetStats(), stk::memory::MemoryAllocator::Stats::min_ever_free, 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 2051 of file freertos_stk.cpp.
| 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 2749 of file freertos_stk.cpp.
| 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 4050 of file freertos_stk.cpp.
| 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 1615 of file freertos_stk.cpp.
References stk::Sleep().
Referenced by clock_task(), and signal_func().
| 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 1623 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 1504 of file freertos_stk.cpp.
References stk::ExitTask(), and stk::GetTid().
| void vTaskEndScheduler | ( | void | ) |
End scheduling (KERNEL_DYNAMIC only). Included for API completeness.
Definition at line 1349 of file freertos_stk.cpp.
References FREERTOS_STK_MAX_TASKS, 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 1952 of file freertos_stk.cpp.
References FREERTOS_STK_MAX_TASKS.
| 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 1881 of file freertos_stk.cpp.
References FREERTOS_STK_MAX_TASKS, and stk::GetTid().
| 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 1641 of file freertos_stk.cpp.
References stk::IKernelService::GetInstance(), and stk::GetTid().
| void vTaskResume | ( | TaskHandle_t | xTaskToResume | ) |
Resume a previously suspended task.
| xTaskToResume | Handle of the task to resume. |
Definition at line 1553 of file freertos_stk.cpp.
References stk::RESUME_DONE, and stk::RESUME_LIFTED.
| 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 3936 of file freertos_stk.cpp.
References configNUM_THREAD_LOCAL_STORAGE_POINTERS, 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 1342 of file freertos_stk.cpp.
Referenced by app_run().
| 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 1532 of file freertos_stk.cpp.
References stk::GetTid(), and stk::SUSPEND_FAIL.
Referenced by app_main().
| void vTaskSuspendAll | ( | void | ) |
Suspend the scheduler (disables preemption; interrupts remain enabled).
Definition at line 1360 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 3304 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 3390 of file freertos_stk.cpp.
| 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 3451 of file freertos_stk.cpp.
| EventGroupHandle_t xEventGroupCreate | ( | void | ) |
Create an event group (all bits initialised to 0).
Definition at line 3345 of file freertos_stk.cpp.
| 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 3354 of file freertos_stk.cpp.
References STK_STATIC_ASSERT_DESC.
| 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 3401 of file freertos_stk.cpp.
| 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 3380 of file freertos_stk.cpp.
| 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 3435 of file freertos_stk.cpp.
References stk::sync::EventFlagsT< uint32_t >::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 3476 of file freertos_stk.cpp.
References stk::sync::EventFlagsT< T >::Sync().
| 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 3409 of file freertos_stk.cpp.
References stk::sync::EventFlagsT< T >::WaitEx().
| 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 4370 of file freertos_stk.cpp.
References stk::memory::BlockMemoryPool::IsStorageValid(), and stk::sync::MessageQueue::IsStorageValid().
| 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 4394 of file freertos_stk.cpp.
References stk::memory::BlockMemoryPool::AlignBlockSize().
| 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 4461 of file freertos_stk.cpp.
References stk::memory::BlockMemoryPool::AlignBlockSize(), and STK_STATIC_ASSERT_DESC.
| 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 4427 of file freertos_stk.cpp.
References stk::memory::BlockMemoryPool::AlignBlockSize(), and stk::sync::MessageQueue::IsStorageValid().
| BaseType_t xMessageBufferIsEmpty | ( | MessageBufferHandle_t | xMessageBuffer | ) |
Return pdTRUE if the message buffer contains no messages.
| xMessageBuffer | Handle of the message buffer. |
Definition at line 4590 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 4599 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 4805 of file freertos_stk.cpp.
References 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 4547 of file freertos_stk.cpp.
References stk::memory::BlockMemoryPool::Free(), stk::sync::MessageQueue::Get(), pdFALSE, STK_ASSERT, stk::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 4734 of file freertos_stk.cpp.
References stk::memory::BlockMemoryPool::Free(), pdFALSE, STK_ASSERT, stk::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 4617 of file freertos_stk.cpp.
References stk::memory::BlockMemoryPool::Free(), 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 4778 of file freertos_stk.cpp.
References stk::memory::BlockMemoryPool::Free(), 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 4499 of file freertos_stk.cpp.
References stk::memory::BlockMemoryPool::Free(), stk::NO_WAIT, pdFALSE, stk::sync::MessageQueue::Put(), STK_ASSERT, stk::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 4685 of file freertos_stk.cpp.
References stk::memory::BlockMemoryPool::Free(), stk::NO_WAIT, pdFALSE, STK_ASSERT, stk::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 4608 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 1284 of file freertos_stk.cpp.
References stk::memory::MemoryAllocator::Stats::GetAvailable(), and stk::memory::MemoryAllocator::GetStats().
| 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 1289 of file freertos_stk.cpp.
References stk::memory::MemoryAllocator::GetStats(), and stk::memory::MemoryAllocator::Stats::min_ever_free.
| 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 2425 of file freertos_stk.cpp.
References stk::sync::MessageQueue::IsEmpty(), 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 1991 of file freertos_stk.cpp.
References stk::sync::MessageQueue::CAPACITY_MAX, and stk::sync::MessageQueue::IsStorageValid().
| 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 2406 of file freertos_stk.cpp.
References stk::sync::MessageQueue::CAPACITY_MAX.
| 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 2017 of file freertos_stk.cpp.
References stk::sync::MessageQueue::CAPACITY_MAX, and STK_STATIC_ASSERT_DESC.
| 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 2349 of file freertos_stk.cpp.
References 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 2361 of file freertos_stk.cpp.
References 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 2295 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 2305 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 2184 of file freertos_stk.cpp.
References pdFAIL, pdPASS, 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 2204 of file freertos_stk.cpp.
References pdFAIL, pdFALSE, pdPASS, 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 2118 of file freertos_stk.cpp.
| 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 2136 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 2104 of file freertos_stk.cpp.
| 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 2250 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 2478 of file freertos_stk.cpp.
References stk::sync::MessageQueue::IsEmpty(), 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 2175 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 2523 of file freertos_stk.cpp.
References stk::sync::MessageQueue::Get().
| 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 2542 of file freertos_stk.cpp.
References 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 2059 of file freertos_stk.cpp.
References pdFAIL, pdPASS, and stk::sync::MessageQueue::Put().
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 2228 of file freertos_stk.cpp.
References pdFAIL, pdFALSE, pdPASS, 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 2078 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 2265 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 2085 of file freertos_stk.cpp.
References pdFAIL, pdPASS, and stk::sync::MessageQueue::PutFront().
| 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 2274 of file freertos_stk.cpp.
References pdFAIL, pdFALSE, pdPASS, and stk::sync::MessageQueue::TryPutFront().
| SemaphoreHandle_t xSemaphoreCreateBinary | ( | void | ) |
Create a binary semaphore (initial count = 0, max = 1).
Definition at line 2563 of file freertos_stk.cpp.
| 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 2579 of file freertos_stk.cpp.
References STK_STATIC_ASSERT_DESC.
| 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 2611 of file freertos_stk.cpp.
| 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 2638 of file freertos_stk.cpp.
References STK_STATIC_ASSERT_DESC.
| SemaphoreHandle_t xSemaphoreCreateMutex | ( | void | ) |
Create a mutex.
Definition at line 2723 of file freertos_stk.cpp.
References CreateMutexInternal().
| 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 2729 of file freertos_stk.cpp.
References CreateMutexStaticInternal().
| SemaphoreHandle_t xSemaphoreCreateRecursiveMutex | ( | void | ) |
Create a recursive mutex (same implementation as xSemaphoreCreateMutex).
Definition at line 2735 of file freertos_stk.cpp.
References CreateMutexInternal().
| 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 2741 of file freertos_stk.cpp.
References CreateMutexStaticInternal().
| 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 2922 of file freertos_stk.cpp.
References 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 2956 of file freertos_stk.cpp.
References 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 2823 of file freertos_stk.cpp.
References stk::GetTid(), pdFAIL, pdPASS, and stk::TID_NONE.
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 2879 of file freertos_stk.cpp.
| BaseType_t xSemaphoreGiveRecursive | ( | SemaphoreHandle_t | xMutex | ) |
Give a recursive mutex.
| xMutex | Handle of the recursive mutex to release. |
Definition at line 2861 of file freertos_stk.cpp.
References pdFAIL, and 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 2757 of file freertos_stk.cpp.
References pdFAIL, and pdPASS.
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 2780 of file freertos_stk.cpp.
| 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 2805 of file freertos_stk.cpp.
References pdFAIL, and 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 4176 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 4004 of file freertos_stk.cpp.
| 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 4027 of file freertos_stk.cpp.
References STK_STATIC_ASSERT_DESC.
| 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 4316 of file freertos_stk.cpp.
References STK_STATIC_ASSERT_DESC.
| 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 4284 of file freertos_stk.cpp.
| 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 4242 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 4192 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 4197 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 4268 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 4113 of file freertos_stk.cpp.
References 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 4148 of file freertos_stk.cpp.
References 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 4202 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 4228 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 4060 of file freertos_stk.cpp.
References 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 4085 of file freertos_stk.cpp.
References 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 4211 of file freertos_stk.cpp.
References stk::sync::Pipe::GetCapacity(), 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 4184 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 1590 of file freertos_stk.cpp.
References stk::GetTid(), pdFAIL, pdFALSE, pdPASS, 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 1405 of file freertos_stk.cpp.
References stk::ADD_OK, FREERTOS_STK_DEFAULT_STACK_WORDS, FREERTOS_STK_MIN_STACK_WORDS, pdFAIL, and pdPASS.
Referenced by app_main(), app_run(), and 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 1858 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 1826 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 1460 of file freertos_stk.cpp.
References stk::ADD_OK, FREERTOS_STK_MIN_STACK_WORDS, and STK_STATIC_ASSERT_DESC.
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 1628 of file freertos_stk.cpp.
References pdFALSE, pdTRUE, and stk::SleepUntil().
Referenced by vTaskDelayUntil().
| TaskHandle_t xTaskGetCurrentTaskHandle | ( | void | ) |
Return the handle of the currently executing task.
Definition at line 1698 of file freertos_stk.cpp.
References stk::GetTid().
Referenced by pvTaskGetThreadLocalStoragePointer(), 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 1706 of file freertos_stk.cpp.
References FREERTOS_STK_MAX_TASKS.
| 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 1387 of file freertos_stk.cpp.
References 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 1371 of file freertos_stk.cpp.
References stk::GetTicks().
| TickType_t xTaskGetTickCountFromISR | ( | void | ) |
Return the tick count from ISR context (ISR-safe).
Definition at line 1376 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 3682 of file freertos_stk.cpp.
References xTaskNotifyIndexed().
Referenced by app_main(), and signal_func().
| 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 3770 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 3804 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 3783 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 3736 of file freertos_stk.cpp.
References pdFAIL, pdPASS, and stk::sync::SemaphoreT< T >::TrySignal().
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 3698 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 3654 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 3672 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 3531 of file freertos_stk.cpp.
References pdFAIL, pdPASS, and stk::sync::SemaphoreT< T >::TrySignal().
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 3592 of file freertos_stk.cpp.
References pdFAIL, pdPASS, and stk::sync::SemaphoreT< T >::TrySignal().
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 3873 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 3838 of file freertos_stk.cpp.
References stk::sync::SemaphoreT< T >::GetCount(), pdFALSE, pdTRUE, and stk::sync::SemaphoreT< T >::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 3689 of file freertos_stk.cpp.
References xTaskNotifyWaitIndexed().
Referenced by clock_task(), phaseA(), phaseB(), phaseC(), and phaseD().
| 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 3615 of file freertos_stk.cpp.
References pdFAIL, pdPASS, and stk::sync::SemaphoreT< T >::Wait().
Referenced by xTaskNotifyWait().
| BaseType_t xTaskResumeAll | ( | void | ) |
Resume a previously suspended scheduler.
Definition at line 1365 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 1570 of file freertos_stk.cpp.
References pdFALSE, pdTRUE, stk::RESUME_DONE, and stk::RESUME_LIFTED.
| 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 3101 of file freertos_stk.cpp.
References 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 3171 of file freertos_stk.cpp.
| 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 2987 of file freertos_stk.cpp.
References 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 3009 of file freertos_stk.cpp.
References pdTRUE, and STK_STATIC_ASSERT_DESC.
| 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 3042 of file freertos_stk.cpp.
References pdFAIL, pdPASS, stk::time::TimerHost::RES_INACTIVE, and stk::time::TimerHost::RES_OK.
| 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 3328 of file freertos_stk.cpp.
| TickType_t xTimerGetPeriod | ( | TimerHandle_t | xTimer | ) |
Return the period of a timer in ticks.
| xTimer | Handle of the timer to query. |
Definition at line 3320 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 3288 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 3226 of file freertos_stk.cpp.
| 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 3257 of file freertos_stk.cpp.
| 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 3096 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 3164 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 3069 of file freertos_stk.cpp.
References pdFAIL.
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 3135 of file freertos_stk.cpp.
References pdFAIL, and pdFALSE.
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 3084 of file freertos_stk.cpp.
References pdFAIL.
| 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 3150 of file freertos_stk.cpp.