foxBMS - Unit Tests  1.5.0
The foxBMS Unit Tests API Documentation
os.h
Go to the documentation of this file.
1 /**
2  *
3  * @copyright © 2010 - 2023, Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e.V.
4  * All rights reserved.
5  *
6  * SPDX-License-Identifier: BSD-3-Clause
7  *
8  * Redistribution and use in source and binary forms, with or without
9  * modification, are permitted provided that the following conditions are met:
10  *
11  * 1. Redistributions of source code must retain the above copyright notice, this
12  * list of conditions and the following disclaimer.
13  *
14  * 2. Redistributions in binary form must reproduce the above copyright notice,
15  * this list of conditions and the following disclaimer in the documentation
16  * and/or other materials provided with the distribution.
17  *
18  * 3. Neither the name of the copyright holder nor the names of its
19  * contributors may be used to endorse or promote products derived from
20  * this software without specific prior written permission.
21  *
22  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
23  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
24  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
25  * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
26  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
27  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
28  * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
29  * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
30  * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
31  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32  *
33  * We kindly request you to use one or more of the following phrases to refer to
34  * foxBMS in your hardware, software, documentation or advertising materials:
35  *
36  * - ″This product uses parts of foxBMS®″
37  * - ″This product includes parts of foxBMS®″
38  * - ″This product is derived from foxBMS®″
39  *
40  */
41 
42 /**
43  * @file os.h
44  * @author foxBMS Team
45  * @date 2019-08-27 (date of creation)
46  * @updated 2023-02-03 (date of last update)
47  * @version v1.5.0
48  * @ingroup OS
49  * @prefix OS
50  *
51  * @brief Declaration of the OS wrapper interface
52  * @details This module describes the interface to different operating systems
53  */
54 
55 #ifndef FOXBMS__OS_H_
56 #define FOXBMS__OS_H_
57 
58 /*========== Includes =======================================================*/
59 
60 #include "fstd_types.h"
61 
62 #if defined(FOXBMS_USES_FREERTOS)
63 #include "FreeRTOS.h"
64 #include "queue.h"
65 #define OS_TASK_HANDLE TaskHandle_t
66 #define OS_QUEUE QueueHandle_t
67 #define OS_IDLE_TASK_STACK_SIZE (configMINIMAL_STACK_SIZE) /**< stack size of the idle task */
68 #define OS_TICK_RATE_MS (portTICK_RATE_MS) /**< FreeRTOS name of the tick rate */
69 #define OS_ENABLE_CACHE (false) /**< true: Enable cache, false: Disable cache */
70 #endif
71 
72 #include <stdbool.h>
73 #include <stdint.h>
74 
75 /*========== Macros and Definitions =========================================*/
76 
77 #if (configUSE_TIMERS > 0) && (configSUPPORT_STATIC_ALLOCATION == 1)
78 #define OS_TIMER_TASK_STACK_SIZE configTIMER_TASK_STACK_DEPTH
79 #endif /* configUSE_TIMERS */
80 
81 /** enum to encapsulate function returns from the OS-wrapper layer */
82 typedef enum {
83  OS_SUCCESS, /**< OS-dependent operation successful */
84  OS_FAIL, /**< OS-dependent operation unsuccessful */
86 
87 /**
88  * @brief typedef for thread priority. The higher the value, the higher the
89  * priority.
90  */
91 typedef enum {
92  OS_PRIORITY_IDLE, /**< priority: idle (lowest) */
93  OS_PRIORITY_LOW, /**< priority: low */
94  OS_PRIORITY_BELOW_NORMAL, /**< priority: below normal */
95  OS_PRIORITY_NORMAL, /**< priority: normal (default) */
96  OS_PRIORITY_ABOVE_NORMAL, /**< priority: above normal */
97  OS_PRIORITY_HIGH, /**< priority: high */
98  OS_PRIORITY_ABOVE_HIGH, /**< priority: above high */
99  OS_PRIORITY_VERY_HIGH, /**< priority: very high */
100  OS_PRIORITY_BELOW_REALTIME, /**< priority: below realtime */
101  OS_PRIORITY_REAL_TIME, /**< priority: realtime (highest) */
102 } OS_PRIORITY_e;
103 
104 /** @brief enum of OS boot states */
105 typedef enum {
106  OS_OFF, /**< system is off */
107  OS_INITIALIZE_SCHEDULER, /**< state right before initializing the scheduler */
108  OS_CREATE_QUEUES, /**< state right before queues are created */
109  OS_CREATE_TASKS, /**< state right before tasks are created */
110  OS_INIT_PRE_OS, /**< state right after tasks are created */
111  OS_SCHEDULER_RUNNING, /**< scheduler is running */
112  OS_ENGINE_RUNNING, /**< state right after scheduler is started and engine is initalized */
113  OS_PRE_CYCLIC_INITIALIZATION_HAS_FINISHED, /**< state after the pre-cyclic init has finished */
114  OS_SYSTEM_RUNNING, /**< system is running */
115  OS_INIT_OS_FATALERROR_SCHEDULER, /**< error in scheduler */
116  OS_INIT_OS_FATALERROR, /**< fatal error */
117  OS_BOOT_STATE_MAX, /**< DO NOT CHANGE, MUST BE THE LAST ENTRY */
119 
120 /** @brief OS timer */
121 typedef struct {
122  uint8_t timer_1ms; /**< milliseconds */
123  uint8_t timer_10ms; /**< 10 milliseconds */
124  uint8_t timer_100ms; /**< 100 milliseconds */
125  uint8_t timer_sec; /**< seconds */
126  uint8_t timer_min; /**< minutes */
127  uint8_t timer_h; /**< hours */
128  uint16_t timer_d; /**< days */
129 } OS_TIMER_s;
130 
131 /** @brief struct for FreeRTOS task definition */
132 typedef struct {
133  OS_PRIORITY_e priority; /*!< priority of the task */
134  uint32_t phase; /*!< shift in ms of the first start of the task */
135  uint32_t cycleTime; /*!< time in ms that will be waited between each task cycle */
136  uint32_t stackSize_B; /*!< Defines the size, in bytes, of the stack allocated to the task */
137  void *pvParameters; /*!< value that is passed as the parameter to the task. */
139 
140 /*========== Extern Constant and Variable Declarations ======================*/
141 /** boot state of the system */
142 extern volatile OS_BOOT_STATE_e os_boot;
143 
144 /** @brief Scheduler "zero" time for task phase control */
145 extern uint32_t os_schedulerStartTime;
146 
147 /*========== Extern Function Prototypes =====================================*/
148 
149 /**
150  * @brief Initialization function for the scheduler
151  */
152 extern void OS_InitializeScheduler(void);
153 
154 /**
155  * @brief Starts the operating system scheduler
156  */
157 extern void OS_StartScheduler(void);
158 
159 /**
160  * @brief Initialization the RTOS interface
161  * @details This function initializes the scheduler and then creates queues and
162  * tasks.
163  */
164 extern void OS_InitializeOperatingSystem(void);
165 
166 #if (configUSE_TIMERS > 0) && (configSUPPORT_STATIC_ALLOCATION == 1)
167 /**
168  * @brief Supplies the memory for the timer task.
169  * @details This is necessary for the combination of
170  * configSUPPORT_STATIC_ALLOCATION and configUSE_TIMERS.
171  * This is an FreeRTOS function an does not adhere to foxBMS function
172  * naming conventions.
173  * @param ppxTimerTaskTCBBuffer TODO
174  * @param ppxTimerTaskStackBuffer TODO
175  * @param pulTimerTaskStackSize TODO
176  */
177 extern void vApplicationGetTimerTaskMemory(
178  StaticTask_t **ppxTimerTaskTCBBuffer,
179  StackType_t **ppxTimerTaskStackBuffer,
180  uint32_t *pulTimerTaskStackSize);
181 #endif /* configUSE_TIMERS */
182 
183 /**
184  * @brief Hook function for the idle task
185  * @details This is an FreeRTOS function an does not adhere to foxBMS function
186  * naming conventions
187  */
188 extern void vApplicationIdleHook(void);
189 
190 /**
191  * @brief Enter Critical interface function for use in FreeRTOS-Tasks and
192  * FreeRTOS-ISR
193  * @details checks the function context (task/thread mode or interrupt
194  * (handler) mode) and calls the corresponding enter-critical
195  * function
196  */
197 extern void OS_EnterTaskCritical(void);
198 
199 /**
200  * @brief Exit Critical interface function for use in FreeRTOS-Tasks and
201  * FreeRTOS-ISR
202  * @details Checks the function context (task/thread mode or interrupt
203  * (handler) mode) and calls the corresponding exit-critical
204  * function
205  */
206 extern void OS_ExitTaskCritical(void);
207 
208 /**
209  * @brief Increments the system timer os_timer
210  * @details The os_timer is a runtime-counter, counting the time since the
211  * last reset.
212  */
213 extern void OS_IncrementTimer(void);
214 
215 /**
216  * @brief Returns OS based system tick value.
217  * @details TODO
218  * @return time stamp in milliseconds, based on the operating system time.
219  */
220 extern uint32_t OS_GetTickCount(void);
221 
222 /**
223  * @brief Delay a task until a specified time
224  * @details TODO
225  * @param pPreviousWakeTime Pointer to a variable that holds the time at
226  * which the task was last unblocked.
227  * PreviousWakeTime must be initialized with the
228  * current time prior to its first use
229  * (PreviousWakeTime = OS_osSysTick()).
230  * @param milliseconds time delay value in milliseconds
231  */
232 extern void OS_DelayTaskUntil(uint32_t *pPreviousWakeTime, uint32_t milliseconds);
233 
234 /**
235  * @brief Marks the current task as requiring FPU context
236  * @details In order to avoid corruption of the registers of the floating
237  * point unit during a task switch, every task that uses the FPU has
238  * to call this function at its start.
239  *
240  * This instructs the underlying operating system to store the context
241  * of the FPU when switching a task.
242  *
243  * This function has to be called from within a task.
244  */
245 extern void OS_MarkTaskAsRequiringFpuContext(void);
246 
247 /**
248  * @brief Wait for a notification
249  * @details This function needs to implement the wrapper to OS specific
250  * blocking task and waiting for notification.
251  * This function must not be called from within an interrupt service
252  * routine (due to the FreeRTOS compatibility of the the wrapper).
253  * This function blocks the current tasks and wait for a notification.
254  * Typically the notification is made in an interrupt.
255  * The notified value is passed by the notifying function.
256  * The tasks unblocks when the notification is received or when
257  * timeout milliseconds have passed.
258  * @param pNotifiedValue Value passed by the notify function
259  * @param timeout ticks to wait before unblocking task if no
260  * notification is received
261  * @return #OS_SUCCESS if a notification was successfully received, otherwise
262  * #OS_FAIL
263  */
264 extern OS_STD_RETURN_e OS_WaitForNotification(uint32_t *pNotifiedValue, uint32_t timeout);
265 
266 /**
267  * @brief Notify a task
268  * @details This function needs to implement the wrapper to OS specific
269  * task notification.
270  * This function is to be called from within an interrupt service
271  * routine (due to the FreeRTOS compatibility of the the wrapper).
272  * This function makes a notification to the task whose handle is
273  * is passed as parameter.
274  * Typically the notification is made in an interrupt.
275  * The value to notify is passed to the notified task.
276  * @param taskToNotify Handle of task to notify.
277  * @param notifiedValue Value to pass to the notified task
278  * @return #OS_SUCCESS if a notification was successfully made, otherwise
279  * #OS_FAIL
280  */
281 extern OS_STD_RETURN_e OS_NotifyFromIsr(TaskHandle_t taskToNotify, uint32_t notifiedValue);
282 
283 /**
284  * @brief Wait for a notification, with index
285  * @details This function needs to implement the wrapper to OS specific
286  * blocking task and waiting for notification.
287  * This function must not be called from within an interrupt service
288  * routine (due to the FreeRTOS compatibility of the the wrapper).
289  * This function blocks the current tasks and wait for a notification
290  * and a specific index.
291  * Typically the notification is made in an interrupt.
292  * The notified value and index are passed by the notifying function.
293  * The tasks unblocks when the notification is received or when
294  * timeout milliseconds have passed.
295  * @param indexToWaitOn index to wait on
296  * @param pNotifiedValue Value passed by the notify function
297  * @param timeout ticks to wait before unblocking task if no
298  * notification is received
299  * @return #OS_SUCCESS if a notification was successfully received, otherwise
300  * #OS_FAIL
301  */
303  uint32_t indexToWaitOn,
304  uint32_t *pNotifiedValue,
305  uint32_t timeout);
306 
307 /**
308  * @brief Notify a task, with index
309  * @details This function needs to implement the wrapper to OS specific
310  * task notification.
311  * This function is to be called from within an interrupt service
312  * routine (due to the FreeRTOS compatibility of the the wrapper).
313  * This function makes a notification with an index to the task whose
314  * handle is passed as parameter.
315  * Typically the notification is made in an interrupt.
316  * The value to notify and the index are passed to the notified task.
317  * @param taskToNotify Handle of task to notify
318  * @param indexToNotify Index to notify
319  * @param notifiedValue Value to pass to the notified task
320  * @return #OS_SUCCESS if a notification was successfully made, otherwise
321  * #OS_FAIL.
322  */
324  TaskHandle_t taskToNotify,
325  uint32_t indexToNotify,
326  uint32_t notifiedValue);
327 
328 /**
329  * @brief Clear pending notification of a task, with index
330  * @details This function needs to implement the wrapper to OS specific
331  * task notification clearing.
332  * It clears the pending notification for the calling task.
333  * This function must not be called from within an interrupt service
334  * routine (due to the FreeRTOS compatibility of the the wrapper).
335  * This function clears a pending notification corresponding to the
336  * index passed as parameter.
337  * @param indexToClear Index of the notification to clear
338  * @return #OS_SUCCESS if a notification was pending, otherwise #OS_FAIL
339  */
340 extern OS_STD_RETURN_e OS_ClearNotificationIndexed(uint32_t indexToClear);
341 
342 /**
343  * @brief Receive an item from a queue
344  * @details This function needs to implement the wrapper to OS specific queue
345  * posting.
346  * The queue needs to be implement in a FreeRTOS compatible way.
347  * This function must not be called from within an interrupt service
348  * routine (due to the FreeRTOS compatibility of the the wrapper).
349  * @param xQueue FreeRTOS compatible queue handle that should be posted
350  * to
351  * @param pvBuffer Pointer to the buffer into which the received item is
352  * posted to.
353  * @param ticksToWait ticks to wait
354  * @return #OS_SUCCESS if an item was successfully received, otherwise
355  * #OS_FAIL.
356  */
357 extern OS_STD_RETURN_e OS_ReceiveFromQueue(OS_QUEUE xQueue, void *const pvBuffer, uint32_t ticksToWait);
358 
359 /**
360  * @brief Post an item to the back the provided queue
361  * @details This function needs to implement the wrapper to OS specific queue
362  * posting.
363  * The queue needs to be implement in a FreeRTOS compatible way.
364  * @param xQueue FreeRTOS compatible queue handle that should be
365  * posted to.
366  * @param pvItemToQueue Pointer to the item to be posted in the queue.
367  * @param ticksToWait ticks to wait
368  * @return #OS_SUCCESS if the item was successfully posted, otherwise #OS_FAIL.
369  */
370 extern OS_STD_RETURN_e OS_SendToBackOfQueue(OS_QUEUE xQueue, const void *const pvItemToQueue, uint32_t ticksToWait);
371 
372 /**
373  * @brief Post an item to the back the provided queue during an ISR
374  * @details This function needs to implement the wrapper to OS specific queue
375  * posting.
376  * @param xQueue queue handle that should be posted to.
377  * @param pvItemToQueue Pointer to the item to be posted in the
378  * queue.
379  * @param pxHigherPriorityTaskWoken Indicates whether a context switch is
380  * required or not.
381  * If the parameter is a NULL_PTR, the
382  * context switch will happen at the next
383  * tick.
384  * @return #OS_SUCCESS if the item was successfully posted, otherwise #OS_FAIL.
385  */
387  OS_QUEUE xQueue,
388  const void *const pvItemToQueue,
389  long *const pxHigherPriorityTaskWoken);
390 
391 /**
392  * @brief Check if messages are waiting for queue
393  * @details This function needs to implement the wrapper to OS specific queue
394  * posting.
395  * @param xQueue queue handle that should be posted to.
396  * @return number of message currently stored in xQueue
397  */
398 extern uint32_t OS_GetNumberOfStoredMessagesInQueue(OS_QUEUE xQueue);
399 
400 /**
401  * @brief This function checks if timeToPass has passed since the last timestamp to now
402  * @details This function retrieves the current time stamp with #OS_GetTickCount(),
403  * compares it to the oldTimestamp_ms and checks if more or equal of
404  * timeToPass_ms timer increments have passed.
405  * @param[in] oldTimeStamp_ms timestamp that shall be compared to the current time in ms
406  * @param[in] timeToPass_ms timer increments (in ms) that shall pass between oldTimeStamp_ms and now
407  * @returns true in the case that more than timeToPass_ms timer increments have passed, otherwise false
408  */
409 extern bool OS_CheckTimeHasPassed(uint32_t oldTimeStamp_ms, uint32_t timeToPass_ms);
410 
411 /**
412  * @brief This function checks if timeToPass has passed since the last timestamp to now
413  * @details This function is passed the current time stamp as argument currentTimeStamp_ms,
414  * compares it to the oldTimestamp_ms and checks if more or equal of
415  * timeToPass_ms timer increments have passed.
416  * @param[in] oldTimeStamp_ms timestamp that shall be compared to the current time in ms
417  * @param[in] currentTimeStamp_ms timestamp of the current time in ms
418  * @param[in] timeToPass_ms timer increments (in ms) that shall pass between oldTimeStamp_ms and now
419  * @returns true in the case that more than timeToPass_ms timer increments have passed, otherwise false
420  */
422  uint32_t oldTimeStamp_ms,
423  uint32_t currentTimeStamp_ms,
424  uint32_t timeToPass_ms);
425 
426 /**
427  * @brief Does a self check if the #OS_CheckTimeHasPassedWithTimestamp works as expected
428  * @details This functions tests some values with #OS_CheckTimeHasPassedWithTimestamp().
429  * It is intended to be side-effect free and to be callable any time to verify
430  * from the running program if this portion of the software is working as
431  * expected.
432  * returns STD_OK if the self check passes successfully, STD_NOT_OK otherwise
433  */
435 
436 /*========== Externalized Static Functions Prototypes (Unit Test) ===========*/
437 #ifdef UNITY_UNIT_TEST
439 #endif
440 
441 #endif /* FOXBMS__OS_H_ */
Definition of foxBMS standard types.
STD_RETURN_TYPE_e
Definition: fstd_types.h:82
OS_STD_RETURN_e OS_NotifyFromIsr(TaskHandle_t taskToNotify, uint32_t notifiedValue)
Notify a task.
Definition: os_freertos.c:176
OS_STD_RETURN_e OS_WaitForNotification(uint32_t *pNotifiedValue, uint32_t timeout)
Wait for a notification.
Definition: os_freertos.c:160
OS_STD_RETURN_e OS_ClearNotificationIndexed(uint32_t indexToClear)
Clear pending notification of a task, with index.
Definition: os_freertos.c:235
OS_STD_RETURN_e OS_ReceiveFromQueue(OS_QUEUE xQueue, void *const pvBuffer, uint32_t ticksToWait)
Receive an item from a queue.
Definition: os_freertos.c:248
void OS_StartScheduler(void)
Starts the operating system scheduler.
Definition: os_freertos.c:81
void OS_DelayTaskUntil(uint32_t *pPreviousWakeTime, uint32_t milliseconds)
Delay a task until a specified time.
Definition: os_freertos.c:146
OS_PRIORITY_e
typedef for thread priority. The higher the value, the higher the priority.
Definition: os.h:91
@ OS_PRIORITY_HIGH
Definition: os.h:97
@ OS_PRIORITY_VERY_HIGH
Definition: os.h:99
@ OS_PRIORITY_BELOW_REALTIME
Definition: os.h:100
@ OS_PRIORITY_NORMAL
Definition: os.h:95
@ OS_PRIORITY_REAL_TIME
Definition: os.h:101
@ OS_PRIORITY_ABOVE_HIGH
Definition: os.h:98
@ OS_PRIORITY_LOW
Definition: os.h:93
@ OS_PRIORITY_BELOW_NORMAL
Definition: os.h:94
@ OS_PRIORITY_IDLE
Definition: os.h:92
@ OS_PRIORITY_ABOVE_NORMAL
Definition: os.h:96
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.
Definition: os_freertos.c:273
uint32_t os_schedulerStartTime
Scheduler "zero" time for task phase control.
Definition: os.c:76
void OS_MarkTaskAsRequiringFpuContext(void)
Marks the current task as requiring FPU context.
Definition: os_freertos.c:156
bool OS_CheckTimeHasPassed(uint32_t oldTimeStamp_ms, uint32_t timeToPass_ms)
This function checks if timeToPass has passed since the last timestamp to now.
Definition: os.c:150
STD_RETURN_TYPE_e OS_CheckTimeHasPassedSelfTest(void)
Does a self check if the OS_CheckTimeHasPassedWithTimestamp works as expected.
Definition: os.c:154
uint32_t OS_GetNumberOfStoredMessagesInQueue(OS_QUEUE xQueue)
Check if messages are waiting for queue.
Definition: os_freertos.c:289
OS_STD_RETURN_e
Definition: os.h:82
@ OS_SUCCESS
Definition: os.h:83
@ OS_FAIL
Definition: os.h:84
OS_BOOT_STATE_e
enum of OS boot states
Definition: os.h:105
@ OS_CREATE_TASKS
Definition: os.h:109
@ OS_INITIALIZE_SCHEDULER
Definition: os.h:107
@ OS_CREATE_QUEUES
Definition: os.h:108
@ OS_INIT_PRE_OS
Definition: os.h:110
@ OS_SCHEDULER_RUNNING
Definition: os.h:111
@ OS_OFF
Definition: os.h:106
@ OS_INIT_OS_FATALERROR
Definition: os.h:116
@ OS_PRE_CYCLIC_INITIALIZATION_HAS_FINISHED
Definition: os.h:113
@ OS_ENGINE_RUNNING
Definition: os.h:112
@ OS_INIT_OS_FATALERROR_SCHEDULER
Definition: os.h:115
@ OS_SYSTEM_RUNNING
Definition: os.h:114
@ OS_BOOT_STATE_MAX
Definition: os.h:117
OS_STD_RETURN_e OS_WaitForNotificationIndexed(uint32_t indexToWaitOn, uint32_t *pNotifiedValue, uint32_t timeout)
Wait for a notification, with index.
Definition: os_freertos.c:194
OS_STD_RETURN_e OS_NotifyIndexedFromIsr(TaskHandle_t taskToNotify, uint32_t indexToNotify, uint32_t notifiedValue)
Notify a task, with index.
Definition: os_freertos.c:214
bool OS_CheckTimeHasPassedWithTimestamp(uint32_t oldTimeStamp_ms, uint32_t currentTimeStamp_ms, uint32_t timeToPass_ms)
This function checks if timeToPass has passed since the last timestamp to now.
Definition: os.c:124
void OS_ExitTaskCritical(void)
Exit Critical interface function for use in FreeRTOS-Tasks and FreeRTOS-ISR.
Definition: os_freertos.c:138
void OS_InitializeOperatingSystem(void)
Initialization the RTOS interface.
Definition: os.c:84
OS_TIMER_s * TEST_OS_GetOsTimer()
Definition: os.c:192
void vApplicationIdleHook(void)
Hook function for the idle task.
Definition: os_freertos.c:123
void OS_IncrementTimer(void)
Increments the system timer os_timer.
Definition: os.c:99
void OS_EnterTaskCritical(void)
Enter Critical interface function for use in FreeRTOS-Tasks and FreeRTOS-ISR.
Definition: os_freertos.c:134
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.
Definition: os_freertos.c:261
void OS_InitializeScheduler(void)
Initialization function for the scheduler.
Definition: os_freertos.c:75
uint32_t OS_GetTickCount(void)
Returns OS based system tick value.
Definition: os_freertos.c:142
volatile OS_BOOT_STATE_e os_boot
Definition: os.c:74
struct for FreeRTOS task definition
Definition: os.h:132
uint32_t cycleTime
Definition: os.h:135
uint32_t stackSize_B
Definition: os.h:136
void * pvParameters
Definition: os.h:137
OS_PRIORITY_e priority
Definition: os.h:133
uint32_t phase
Definition: os.h:134
OS timer.
Definition: os.h:121
uint8_t timer_min
Definition: os.h:126
uint8_t timer_1ms
Definition: os.h:122
uint8_t timer_sec
Definition: os.h:125
uint8_t timer_100ms
Definition: os.h:124
uint8_t timer_10ms
Definition: os.h:123
uint8_t timer_h
Definition: os.h:127
uint16_t timer_d
Definition: os.h:128