foxBMS - Unit Tests
1.2.1
The foxBMS Unit Tests API Documentation
|
FreeRTOS specific implementation of the tasks and resources used by the system. More...
Go to the source code of this file.
Functions | |
void | OS_StartScheduler (void) |
Starts the operating system scheduler. More... | |
void | vApplicationGetIdleTaskMemory (StaticTask_t **ppxIdleTaskTCBBuffer, StackType_t **ppxIdleTaskStackBuffer, uint32_t *pulIdleTaskStackSize) |
void | vApplicationIdleHook (void) |
Hook function for the idle task. More... | |
void | OS_EnterTaskCritical (void) |
Enter Critical interface function for use in FreeRTOS-Tasks and FreeRTOS-ISR. More... | |
void | OS_ExitTaskCritical (void) |
Exit Critical interface function for use in FreeRTOS-Tasks and FreeRTOS-ISR. More... | |
uint32_t | OS_GetTickCount (void) |
Returns OS based system tick value. More... | |
void | OS_DelayTaskUntil (uint32_t *pPreviousWakeTime, uint32_t milliseconds) |
Delay a task until a specified time. More... | |
void | OS_SystemTickHandler (void) |
Handles the tick increment of operating systick timer. More... | |
void | OS_MarkTaskAsRequiringFpuContext (void) |
Marks the current task as requiring FPU context. More... | |
OS_STD_RETURN_e | OS_ReceiveFromQueue (OS_QUEUE xQueue, void *const pvBuffer, uint32_t ticksToWait) |
Receive an item from a queue. More... | |
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. More... | |
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. More... | |
FreeRTOS specific implementation of the tasks and resources used by the system.
SPDX-License-Identifier: BSD-3-Clause
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
We kindly request you to use one or more of the following phrases to refer to foxBMS in your hardware, software, documentation or advertising materials:
Definition in file os_freertos.c.
void OS_DelayTaskUntil | ( | uint32_t * | pPreviousWakeTime, |
uint32_t | milliseconds | ||
) |
Delay a task until a specified time.
TODO
pPreviousWakeTime | Pointer to a variable that holds the time at which the task was last unblocked. PreviousWakeTime must be initialized with the current time prior to its first use (PreviousWakeTime = OS_osSysTick()). |
milliseconds | time delay value in milliseconds |
Definition at line 133 of file os_freertos.c.
void OS_EnterTaskCritical | ( | void | ) |
Enter Critical interface function for use in FreeRTOS-Tasks and FreeRTOS-ISR.
checks the function context (task/thread mode or interrupt (handler) mode) and calls the corresponding enter-critical function
Definition at line 121 of file os_freertos.c.
void OS_ExitTaskCritical | ( | void | ) |
Exit Critical interface function for use in FreeRTOS-Tasks and FreeRTOS-ISR.
Checks the function context (task/thread mode or interrupt (handler) mode) and calls the corresponding exit-critical function
Definition at line 125 of file os_freertos.c.
uint32_t OS_GetTickCount | ( | void | ) |
Returns OS based system tick value.
TODO
Definition at line 129 of file os_freertos.c.
void OS_MarkTaskAsRequiringFpuContext | ( | void | ) |
Marks the current task as requiring FPU context.
In order to avoid corruption of the registers of the floating point unit during a task switch, every task that uses the FPU has to call this function at its start.
This instructs the underlying operating system to store the context of the FPU when switching a task.
This function has to be called from within a task.
Definition at line 159 of file os_freertos.c.
OS_STD_RETURN_e OS_ReceiveFromQueue | ( | OS_QUEUE | xQueue, |
void *const | pvBuffer, | ||
uint32_t | ticksToWait | ||
) |
Receive an item from a queue.
This function needs to implement the wrapper to OS specfic queue posting. The queue needs to be implement in a FreeRTOS compatible way. This function must not be called from within an interrupt service routine (due to the FreeRTOS compatibility of the the wrapper).
xQueue | FreeRTOS compatible queue handle that should be posted to |
pvBuffer | Pointer to the buffer into which the received item is posted to. |
ticksToWait | ticks to wait |
Definition at line 163 of file os_freertos.c.
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.
This function needs to implement the wrapper to OS specfic queue posting. The queue needs to be implement in a FreeRTOS compatible way.
xQueue | FreeRTOS compatible queue handle that should be posted to. |
pvItemToQueue | Pointer to the item to be posted in the queue. |
ticksToWait | ticks to wait |
Definition at line 176 of file os_freertos.c.
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.
This function needs to implement the wrapper to OS specfic queue posting. The queue needs to be implement in a FreeRTOS compatible way.
xQueue | FreeRTOS compatible queue handle that should be posted to. |
pvItemToQueue | Pointer to the item to be posted in the queue. |
pxHigherPriorityTaskWoken | Indicates whether a context switch is required or not. If the parameter is a NULL_PTR, the context switch will happen at the next tick. |
Definition at line 188 of file os_freertos.c.
void OS_StartScheduler | ( | void | ) |
Starts the operating system scheduler.
Definition at line 71 of file os_freertos.c.
void OS_SystemTickHandler | ( | void | ) |
Handles the tick increment of operating systick timer.
TODO
Definition at line 148 of file os_freertos.c.
void vApplicationGetIdleTaskMemory | ( | StaticTask_t ** | ppxIdleTaskTCBBuffer, |
StackType_t ** | ppxIdleTaskStackBuffer, | ||
uint32_t * | pulIdleTaskStackSize | ||
) |
Buffer for the Idle Task's structure
Stack for the Idle task
Definition at line 75 of file os_freertos.c.
void vApplicationIdleHook | ( | void | ) |
Hook function for the idle task.
This is an FreeRTOS function an does not adhere to foxBMS function naming convetions
Definition at line 111 of file os_freertos.c.