72 vTaskStartScheduler();
76 StaticTask_t **ppxIdleTaskTCBBuffer,
77 StackType_t **ppxIdleTaskStackBuffer,
78 uint32_t *pulIdleTaskStackSize) {
80 static StaticTask_t os_idleTask = {0};
86 *ppxIdleTaskTCBBuffer = &os_idleTask;
87 *ppxIdleTaskStackBuffer = &os_stackSizeIdle[0];
91 #if (configUSE_TIMERS > 0) && (configSUPPORT_STATIC_ALLOCATION == 1)
92 void vApplicationGetTimerTaskMemory(
93 StaticTask_t **ppxTimerTaskTCBBuffer,
94 StackType_t **ppxTimerTaskStackBuffer,
95 uint32_t *pulTimerTaskStackSize) {
96 #if (configUSE_TIMERS > 0) && (configSUPPORT_STATIC_ALLOCATION == 1)
98 static StaticTask_t os_timerTask;
101 #if (configUSE_TIMERS > 0) && (configSUPPORT_STATIC_ALLOCATION == 1)
103 static StackType_t os_stackSizeTimer[OS_TIMER_TASK_STACK_SIZE];
105 *ppxTimerTaskTCBBuffer = &os_timerTask;
106 *ppxTimerTaskStackBuffer = &os_stackSizeTimer[0];
107 *pulTimerTaskStackSize = configTIMER_TASK_STACK_DEPTH;
115 #if (configCHECK_FOR_STACK_OVERFLOW > 0)
116 void vApplicationStackOverflowHook(TaskHandle_t xTask,
char *pcTaskName) {
122 taskENTER_CRITICAL();
130 return xTaskGetTickCount();
134 #if INCLUDE_vTaskDelayUntil
137 TickType_t ticks = ((TickType_t)milliseconds / portTICK_PERIOD_MS);
138 if ((uint32_t)ticks < 1u) {
141 vTaskDelayUntil((TickType_t *)pPreviousWakeTime, ticks);
144 #error "Can't use OS_taskDelayUntil."
149 #if (INCLUDE_xTaskGetSchedulerState == 1)
151 if (xTaskGetSchedulerState() != taskSCHEDULER_NOT_STARTED) {
152 xTaskIncrementTick();
155 xTaskIncrementTick();
168 BaseType_t xQueueReceiveSuccess = xQueueReceive(xQueue, pvBuffer, (TickType_t)ticksToWait);
170 if (xQueueReceiveSuccess == pdTRUE) {
173 return queueReceiveSucessfull;
180 BaseType_t xQueueSendSuccess = xQueueSendToBack(xQueue, pvItemToQueue, ticksToWait);
182 if (xQueueSendSuccess == pdTRUE) {
185 return queueSendSucessfull;
190 const void *
const pvItemToQueue,
191 long *
const pxHigherPriorityTaskWoken) {
195 BaseType_t xQueueSendSuccess =
196 xQueueSendToBackFromISR(xQueue, pvItemToQueue, (BaseType_t *)pxHigherPriorityTaskWoken);
198 if (xQueueSendSuccess == pdTRUE) {
201 return queueSendSucessfull;
205 #ifdef UNITY_UNIT_TEST
#define FAS_ASSERT(x)
Assertion macro that asserts that x is true.
#define FAS_TRAP
Define that evaluates to essential boolean false thus tripping an assert.
#define NULL_PTR
Null pointer.
Header of task driver implementation.
void FTSK_RunUserCodeIdle(void)
Idle task.
Declaration of the OS wrapper interface.
enum OS_STD_RETURN OS_STD_RETURN_e
#define OS_IDLE_TASK_STACK_SIZE
void vApplicationGetIdleTaskMemory(StaticTask_t **ppxIdleTaskTCBBuffer, StackType_t **ppxIdleTaskStackBuffer, uint32_t *pulIdleTaskStackSize)
OS_STD_RETURN_e OS_ReceiveFromQueue(OS_QUEUE xQueue, void *const pvBuffer, uint32_t ticksToWait)
Receive an item from a queue.
void OS_StartScheduler(void)
Starts the operating system scheduler.
void OS_SystemTickHandler(void)
Handles the tick increment of operating systick timer.
void OS_DelayTaskUntil(uint32_t *pPreviousWakeTime, uint32_t milliseconds)
Delay a task until a specified time.
OS_STD_RETURN_e OS_SendToBackOfQueueFromIsr(OS_QUEUE xQueue, const void *const pvItemToQueue, long *const pxHigherPriorityTaskWoken)
Post an item to the back the provided queue during an ISR.
void OS_MarkTaskAsRequiringFpuContext(void)
Marks the current task as requiring FPU context.
OS_STD_RETURN_e OS_SendToBackOfQueue(OS_QUEUE xQueue, const void *const pvItemToQueue, TickType_t ticksToWait)
Post an item to the back the provided queue.
void OS_ExitTaskCritical(void)
Exit Critical interface function for use in FreeRTOS-Tasks and FreeRTOS-ISR.
void vApplicationIdleHook(void)
Hook function for the idle task.
void OS_EnterTaskCritical(void)
Enter Critical interface function for use in FreeRTOS-Tasks and FreeRTOS-ISR.
uint32_t OS_GetTickCount(void)
Returns OS based system tick value.