58 #include "HL_sys_core.h"
74 if (OS_ENABLE_CACHE ==
true) {
80 vTaskStartScheduler();
86 StaticTask_t **ppxIdleTaskTCBBuffer,
87 StackType_t **ppxIdleTaskStackBuffer,
88 uint32_t *pulIdleTaskStackSize) {
90 static StaticTask_t os_idleTask = {0};
92 static StackType_t os_stackSizeIdle[OS_IDLE_TASK_STACK_SIZE] = {0};
96 *ppxIdleTaskTCBBuffer = &os_idleTask;
97 *ppxIdleTaskStackBuffer = &os_stackSizeIdle[0];
98 *pulIdleTaskStackSize = OS_IDLE_TASK_STACK_SIZE;
101 #if (configUSE_TIMERS > 0) && (configSUPPORT_STATIC_ALLOCATION == 1)
102 void vApplicationGetTimerTaskMemory(
103 StaticTask_t **ppxTimerTaskTCBBuffer,
104 StackType_t **ppxTimerTaskStackBuffer,
105 uint32_t *pulTimerTaskStackSize) {
106 #if (configUSE_TIMERS > 0) && (configSUPPORT_STATIC_ALLOCATION == 1)
108 static StaticTask_t os_timerTask;
111 #if (configUSE_TIMERS > 0) && (configSUPPORT_STATIC_ALLOCATION == 1)
113 static StackType_t os_stackSizeTimer[OS_TIMER_TASK_STACK_SIZE];
115 *ppxTimerTaskTCBBuffer = &os_timerTask;
116 *ppxTimerTaskStackBuffer = &os_stackSizeTimer[0];
117 *pulTimerTaskStackSize = configTIMER_TASK_STACK_DEPTH;
125 #if (configCHECK_FOR_STACK_OVERFLOW > 0)
126 void vApplicationStackOverflowHook(TaskHandle_t xTask,
char *pcTaskName) {
132 taskENTER_CRITICAL();
140 return xTaskGetTickCount();
146 uint32_t ticks = (milliseconds / OS_TICK_RATE_MS);
147 if ((uint32_t)ticks < 1u) {
150 vTaskDelayUntil((TickType_t *)pPreviousWakeTime, (TickType_t)ticks);
162 BaseType_t xQueueReceiveSuccess = xQueueReceive(xQueue, pvBuffer, (TickType_t)ticksToWait);
164 if (xQueueReceiveSuccess == pdTRUE) {
167 return queueReceiveSuccessfully;
174 BaseType_t xQueueSendSuccess = xQueueSendToBack(xQueue, pvItemToQueue, (TickType_t)ticksToWait);
176 if (xQueueSendSuccess == pdTRUE) {
179 return queueSendSuccessfully;
184 const void *
const pvItemToQueue,
185 long *
const pxHigherPriorityTaskWoken) {
189 BaseType_t xQueueSendSuccess =
190 xQueueSendToBackFromISR(xQueue, pvItemToQueue, (BaseType_t *)pxHigherPriorityTaskWoken);
192 if (xQueueSendSuccess == pdTRUE) {
195 return queueSendSuccessfully;
199 long numberOfMessages = uxQueueMessagesWaiting(xQueue);
200 return (uint32_t)numberOfMessages;
204 #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.
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_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.
uint32_t OS_GetNumberOfStoredMessagesInQueue(OS_QUEUE xQueue)
Check if messages are waiting for 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.
OS_STD_RETURN_e OS_SendToBackOfQueue(OS_QUEUE xQueue, const void *const pvItemToQueue, uint32_t ticksToWait)
Post an item to the back the provided queue.
void OS_InitializeScheduler(void)
Initialization function for the scheduler.
uint32_t OS_GetTickCount(void)
Returns OS based system tick value.