foxBMS  1.6.0
The foxBMS Battery Management System 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-10-12 (date of last update)
47  * @version v1.6.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 /* clang-format off */
63 #include <stdbool.h>
64 /* clang-format on */
65 
66 #if defined(FOXBMS_USES_FREERTOS)
67 #include "FreeRTOS.h"
68 #include "queue.h"
69 #define OS_TASK_HANDLE TaskHandle_t
70 #define OS_QUEUE QueueHandle_t
71 #define OS_IDLE_TASK_STACK_SIZE (configMINIMAL_STACK_SIZE) /**< stack size of the idle task */
72 #define OS_TICK_RATE_MS (portTICK_RATE_MS) /**< FreeRTOS name of the tick rate */
73 #define OS_ENABLE_CACHE (false) /**< true: Enable cache, false: Disable cache */
74 #endif
75 
76 #include <stdint.h>
77 
78 /*========== Macros and Definitions =========================================*/
79 
80 #if (configUSE_TIMERS > 0) && (configSUPPORT_STATIC_ALLOCATION == 1)
81 #define OS_TIMER_TASK_STACK_SIZE configTIMER_TASK_STACK_DEPTH
82 #endif /* configUSE_TIMERS */
83 
84 /** enum to encapsulate function returns from the OS-wrapper layer */
85 typedef enum {
86  OS_SUCCESS, /**< OS-dependent operation successful */
87  OS_FAIL, /**< OS-dependent operation unsuccessful */
89 
90 /**
91  * @brief typedef for thread priority. The higher the value, the higher the
92  * priority.
93  */
94 typedef enum {
95  OS_PRIORITY_IDLE, /**< priority: idle (lowest) */
96  OS_PRIORITY_LOW, /**< priority: low */
97  OS_PRIORITY_BELOW_NORMAL, /**< priority: below normal */
98  OS_PRIORITY_NORMAL, /**< priority: normal (default) */
99  OS_PRIORITY_ABOVE_NORMAL, /**< priority: above normal */
100  OS_PRIORITY_HIGH, /**< priority: high */
101  OS_PRIORITY_ABOVE_HIGH, /**< priority: above high */
102  OS_PRIORITY_VERY_HIGH, /**< priority: very high */
103  OS_PRIORITY_BELOW_REALTIME, /**< priority: below realtime */
104  OS_PRIORITY_REAL_TIME, /**< priority: realtime (highest) */
105 } OS_PRIORITY_e;
106 
107 /** @brief enum of OS boot states */
108 typedef enum {
109  OS_OFF, /**< system is off */
110  OS_INITIALIZE_SCHEDULER, /**< state right before initializing the scheduler */
111  OS_CREATE_QUEUES, /**< state right before queues are created */
112  OS_CREATE_TASKS, /**< state right before tasks are created */
113  OS_INIT_PRE_OS, /**< state right after tasks are created */
114  OS_SCHEDULER_RUNNING, /**< scheduler is running */
115  OS_ENGINE_RUNNING, /**< state right after scheduler is started and engine is initalized */
116  OS_PRE_CYCLIC_INITIALIZATION_HAS_FINISHED, /**< state after the pre-cyclic init has finished */
117  OS_SYSTEM_RUNNING, /**< system is running */
118  OS_INIT_OS_FATALERROR_SCHEDULER, /**< error in scheduler */
119  OS_INIT_OS_FATALERROR, /**< fatal error */
120  OS_BOOT_STATE_MAX, /**< DO NOT CHANGE, MUST BE THE LAST ENTRY */
122 
123 /** @brief OS timer */
124 typedef struct {
125  uint8_t timer_1ms; /**< milliseconds */
126  uint8_t timer_10ms; /**< 10 milliseconds */
127  uint8_t timer_100ms; /**< 100 milliseconds */
128  uint8_t timer_sec; /**< seconds */
129  uint8_t timer_min; /**< minutes */
130  uint8_t timer_h; /**< hours */
131  uint16_t timer_d; /**< days */
132 } OS_TIMER_s;
133 
134 /** @brief struct for FreeRTOS task definition */
135 typedef struct {
136  OS_PRIORITY_e priority; /*!< priority of the task */
137  uint32_t phase; /*!< shift in ms of the first start of the task */
138  uint32_t cycleTime; /*!< time in ms that will be waited between each task cycle */
139  uint32_t stackSize_B; /*!< Defines the size, in bytes, of the stack allocated to the task */
140  void *pvParameters; /*!< value that is passed as the parameter to the task. */
142 
143 /*========== Extern Constant and Variable Declarations ======================*/
144 /** boot state of the system */
145 extern volatile OS_BOOT_STATE_e os_boot;
146 
147 /** @brief Scheduler "zero" time for task phase control */
148 extern uint32_t os_schedulerStartTime;
149 
150 /*========== Extern Function Prototypes =====================================*/
151 
152 /**
153  * @brief Initialization function for the scheduler
154  */
155 extern void OS_InitializeScheduler(void);
156 
157 /**
158  * @brief Starts the operating system scheduler
159  */
160 extern void OS_StartScheduler(void);
161 
162 /**
163  * @brief Initialization the RTOS interface
164  * @details This function initializes the scheduler and then creates queues and
165  * tasks.
166  */
167 extern void OS_InitializeOperatingSystem(void);
168 
169 #if (configUSE_TIMERS > 0) && (configSUPPORT_STATIC_ALLOCATION == 1)
170 /**
171  * @brief Supplies the memory for the timer task.
172  * @details This is necessary for the combination of
173  * configSUPPORT_STATIC_ALLOCATION and configUSE_TIMERS.
174  * This is an FreeRTOS function an does not adhere to foxBMS function
175  * naming conventions.
176  * @param ppxTimerTaskTCBBuffer TODO
177  * @param ppxTimerTaskStackBuffer TODO
178  * @param pulTimerTaskStackSize TODO
179  */
180 extern void vApplicationGetTimerTaskMemory(
181  StaticTask_t **ppxTimerTaskTCBBuffer,
182  StackType_t **ppxTimerTaskStackBuffer,
183  uint32_t *pulTimerTaskStackSize);
184 #endif /* configUSE_TIMERS */
185 
186 /**
187  * @brief Hook function for the idle task
188  * @details This is an FreeRTOS function an does not adhere to foxBMS function
189  * naming conventions
190  */
191 extern void vApplicationIdleHook(void);
192 
193 /**
194  * @brief Enter Critical interface function for use in FreeRTOS-Tasks and
195  * FreeRTOS-ISR
196  * @details checks the function context (task/thread mode or interrupt
197  * (handler) mode) and calls the corresponding enter-critical
198  * function
199  */
200 extern void OS_EnterTaskCritical(void);
201 
202 /**
203  * @brief Exit Critical interface function for use in FreeRTOS-Tasks and
204  * FreeRTOS-ISR
205  * @details Checks the function context (task/thread mode or interrupt
206  * (handler) mode) and calls the corresponding exit-critical
207  * function
208  */
209 extern void OS_ExitTaskCritical(void);
210 
211 /**
212  * @brief Increments the system timer os_timer
213  * @details The os_timer is a runtime-counter, counting the time since the
214  * last reset.
215  */
216 extern void OS_IncrementTimer(void);
217 
218 /**
219  * @brief Returns OS based system tick value.
220  * @details TODO
221  * @return time stamp in milliseconds, based on the operating system time.
222  */
223 extern uint32_t OS_GetTickCount(void);
224 
225 /**
226  * @brief Delay a task until a specified time
227  * @details TODO
228  * @param pPreviousWakeTime Pointer to a variable that holds the time at
229  * which the task was last unblocked.
230  * PreviousWakeTime must be initialized with the
231  * current time prior to its first use
232  * (PreviousWakeTime = OS_osSysTick()).
233  * @param milliseconds time delay value in milliseconds
234  */
235 extern void OS_DelayTaskUntil(uint32_t *pPreviousWakeTime, uint32_t milliseconds);
236 
237 /**
238  * @brief Marks the current task as requiring FPU context
239  * @details In order to avoid corruption of the registers of the floating
240  * point unit during a task switch, every task that uses the FPU has
241  * to call this function at its start.
242  *
243  * This instructs the underlying operating system to store the context
244  * of the FPU when switching a task.
245  *
246  * This function has to be called from within a task.
247  */
248 extern void OS_MarkTaskAsRequiringFpuContext(void);
249 
250 /**
251  * @brief Wait for a notification
252  * @details This function needs to implement the wrapper to OS specific
253  * blocking task and waiting for notification.
254  * This function must not be called from within an interrupt service
255  * routine (due to the FreeRTOS compatibility of the the wrapper).
256  * This function blocks the current tasks and wait for a notification.
257  * Typically the notification is made in an interrupt.
258  * The notified value is passed by the notifying function.
259  * The tasks unblocks when the notification is received or when
260  * timeout milliseconds have passed.
261  * @param pNotifiedValue Value passed by the notify function
262  * @param timeout ticks to wait before unblocking task if no
263  * notification is received
264  * @return #OS_SUCCESS if a notification was successfully received, otherwise
265  * #OS_FAIL
266  */
267 extern OS_STD_RETURN_e OS_WaitForNotification(uint32_t *pNotifiedValue, uint32_t timeout);
268 
269 /**
270  * @brief Notify a task
271  * @details This function needs to implement the wrapper to OS specific
272  * task notification.
273  * This function is to be called from within an interrupt service
274  * routine (due to the FreeRTOS compatibility of the the wrapper).
275  * This function makes a notification to the task whose handle is
276  * is passed as parameter.
277  * Typically the notification is made in an interrupt.
278  * The value to notify is passed to the notified task.
279  * @param taskToNotify Handle of task to notify.
280  * @param notifiedValue Value to pass to the notified task
281  * @return #OS_SUCCESS if a notification was successfully made, otherwise
282  * #OS_FAIL
283  */
284 extern OS_STD_RETURN_e OS_NotifyFromIsr(TaskHandle_t taskToNotify, uint32_t notifiedValue);
285 
286 /**
287  * @brief Wait for a notification, with index
288  * @details This function needs to implement the wrapper to OS specific
289  * blocking task and waiting for notification.
290  * This function must not be called from within an interrupt service
291  * routine (due to the FreeRTOS compatibility of the the wrapper).
292  * This function blocks the current tasks and wait for a notification
293  * and a specific index.
294  * Typically the notification is made in an interrupt.
295  * The notified value and index are passed by the notifying function.
296  * The tasks unblocks when the notification is received or when
297  * timeout milliseconds have passed.
298  * @param indexToWaitOn index to wait on
299  * @param pNotifiedValue Value passed by the notify function
300  * @param timeout ticks to wait before unblocking task if no
301  * notification is received
302  * @return #OS_SUCCESS if a notification was successfully received, otherwise
303  * #OS_FAIL
304  */
306  uint32_t indexToWaitOn,
307  uint32_t *pNotifiedValue,
308  uint32_t timeout);
309 
310 /**
311  * @brief Notify a task, with index
312  * @details This function needs to implement the wrapper to OS specific
313  * task notification.
314  * This function is to be called from within an interrupt service
315  * routine (due to the FreeRTOS compatibility of the the wrapper).
316  * This function makes a notification with an index to the task whose
317  * handle is passed as parameter.
318  * Typically the notification is made in an interrupt.
319  * The value to notify and the index are passed to the notified task.
320  * @param taskToNotify Handle of task to notify
321  * @param indexToNotify Index to notify
322  * @param notifiedValue Value to pass to the notified task
323  * @return #OS_SUCCESS if a notification was successfully made, otherwise
324  * #OS_FAIL.
325  */
327  TaskHandle_t taskToNotify,
328  uint32_t indexToNotify,
329  uint32_t notifiedValue);
330 
331 /**
332  * @brief Clear pending notification of a task, with index
333  * @details This function needs to implement the wrapper to OS specific
334  * task notification clearing.
335  * It clears the pending notification for the calling task.
336  * This function must not be called from within an interrupt service
337  * routine (due to the FreeRTOS compatibility of the the wrapper).
338  * This function clears a pending notification corresponding to the
339  * index passed as parameter.
340  * @param indexToClear Index of the notification to clear
341  * @return #OS_SUCCESS if a notification was pending, otherwise #OS_FAIL
342  */
343 extern OS_STD_RETURN_e OS_ClearNotificationIndexed(uint32_t indexToClear);
344 
345 /**
346  * @brief Receive an item from a queue
347  * @details This function needs to implement the wrapper to OS specific queue
348  * posting.
349  * The queue needs to be implement in a FreeRTOS compatible way.
350  * This function must not be called from within an interrupt service
351  * routine (due to the FreeRTOS compatibility of the the wrapper).
352  * @param xQueue FreeRTOS compatible queue handle that should be posted
353  * to
354  * @param pvBuffer Pointer to the buffer into which the received item is
355  * posted to.
356  * @param ticksToWait ticks to wait
357  * @return #OS_SUCCESS if an item was successfully received, otherwise
358  * #OS_FAIL.
359  */
360 extern OS_STD_RETURN_e OS_ReceiveFromQueue(OS_QUEUE xQueue, void *const pvBuffer, uint32_t ticksToWait);
361 
362 /**
363  * @brief Post an item to the back the provided queue
364  * @details This function needs to implement the wrapper to OS specific queue
365  * posting.
366  * The queue needs to be implement in a FreeRTOS compatible way.
367  * @param xQueue FreeRTOS compatible queue handle that should be
368  * posted to.
369  * @param pvItemToQueue Pointer to the item to be posted in the queue.
370  * @param ticksToWait ticks to wait
371  * @return #OS_SUCCESS if the item was successfully posted, otherwise #OS_FAIL.
372  */
373 extern OS_STD_RETURN_e OS_SendToBackOfQueue(OS_QUEUE xQueue, const void *const pvItemToQueue, uint32_t ticksToWait);
374 
375 /**
376  * @brief Post an item to the back the provided queue during an ISR
377  * @details This function needs to implement the wrapper to OS specific queue
378  * posting.
379  * @param xQueue queue handle that should be posted to.
380  * @param pvItemToQueue Pointer to the item to be posted in the
381  * queue.
382  * @param pxHigherPriorityTaskWoken Indicates whether a context switch is
383  * required or not.
384  * If the parameter is a NULL_PTR, the
385  * context switch will happen at the next
386  * tick.
387  * @return #OS_SUCCESS if the item was successfully posted, otherwise #OS_FAIL.
388  */
390  OS_QUEUE xQueue,
391  const void *const pvItemToQueue,
392  long *const pxHigherPriorityTaskWoken);
393 
394 /**
395  * @brief Check if messages are waiting for queue
396  * @details This function needs to implement the wrapper to OS specific queue
397  * posting.
398  * @param xQueue queue handle that should be posted to.
399  * @return number of message currently stored in xQueue
400  */
401 extern uint32_t OS_GetNumberOfStoredMessagesInQueue(OS_QUEUE xQueue);
402 
403 /**
404  * @brief This function checks if timeToPass has passed since the last timestamp to now
405  * @details This function retrieves the current time stamp with #OS_GetTickCount(),
406  * compares it to the oldTimestamp_ms and checks if more or equal of
407  * timeToPass_ms timer increments have passed.
408  * @param[in] oldTimeStamp_ms timestamp that shall be compared to the current time in ms
409  * @param[in] timeToPass_ms timer increments (in ms) that shall pass between oldTimeStamp_ms and now
410  * @returns true in the case that more than timeToPass_ms timer increments have passed, otherwise false
411  */
412 extern bool OS_CheckTimeHasPassed(uint32_t oldTimeStamp_ms, uint32_t timeToPass_ms);
413 
414 /**
415  * @brief This function checks if timeToPass has passed since the last timestamp to now
416  * @details This function is passed the current time stamp as argument currentTimeStamp_ms,
417  * compares it to the oldTimestamp_ms and checks if more or equal of
418  * timeToPass_ms timer increments have passed.
419  * @param[in] oldTimeStamp_ms timestamp that shall be compared to the current time in ms
420  * @param[in] currentTimeStamp_ms timestamp of the current time in ms
421  * @param[in] timeToPass_ms timer increments (in ms) that shall pass between oldTimeStamp_ms and now
422  * @returns true in the case that more than timeToPass_ms timer increments have passed, otherwise false
423  */
425  uint32_t oldTimeStamp_ms,
426  uint32_t currentTimeStamp_ms,
427  uint32_t timeToPass_ms);
428 
429 /**
430  * @brief Does a self check if the #OS_CheckTimeHasPassedWithTimestamp works as expected
431  * @details This functions tests some values with #OS_CheckTimeHasPassedWithTimestamp().
432  * It is intended to be side-effect free and to be callable any time to verify
433  * from the running program if this portion of the software is working as
434  * expected.
435  * returns STD_OK if the self check passes successfully, STD_NOT_OK otherwise
436  */
438 
439 /*========== Externalized Static Functions Prototypes (Unit Test) ===========*/
440 #ifdef UNITY_UNIT_TEST
441 extern OS_TIMER_s *TEST_OS_GetOsTimer();
442 #endif
443 
444 #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:192
OS_STD_RETURN_e OS_WaitForNotification(uint32_t *pNotifiedValue, uint32_t timeout)
Wait for a notification.
Definition: os_freertos.c:176
OS_STD_RETURN_e OS_ClearNotificationIndexed(uint32_t indexToClear)
Clear pending notification of a task, with index.
Definition: os_freertos.c:251
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:264
void OS_StartScheduler(void)
Starts the operating system scheduler.
Definition: os_freertos.c:82
void OS_DelayTaskUntil(uint32_t *pPreviousWakeTime, uint32_t milliseconds)
Delay a task until a specified time.
Definition: os_freertos.c:162
OS_PRIORITY_e
typedef for thread priority. The higher the value, the higher the priority.
Definition: os.h:94
@ OS_PRIORITY_HIGH
Definition: os.h:100
@ OS_PRIORITY_VERY_HIGH
Definition: os.h:102
@ OS_PRIORITY_BELOW_REALTIME
Definition: os.h:103
@ OS_PRIORITY_NORMAL
Definition: os.h:98
@ OS_PRIORITY_REAL_TIME
Definition: os.h:104
@ OS_PRIORITY_ABOVE_HIGH
Definition: os.h:101
@ OS_PRIORITY_LOW
Definition: os.h:96
@ OS_PRIORITY_BELOW_NORMAL
Definition: os.h:97
@ OS_PRIORITY_IDLE
Definition: os.h:95
@ OS_PRIORITY_ABOVE_NORMAL
Definition: os.h:99
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:289
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:172
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:305
OS_STD_RETURN_e
Definition: os.h:85
@ OS_SUCCESS
Definition: os.h:86
@ OS_FAIL
Definition: os.h:87
OS_BOOT_STATE_e
enum of OS boot states
Definition: os.h:108
@ OS_CREATE_TASKS
Definition: os.h:112
@ OS_INITIALIZE_SCHEDULER
Definition: os.h:110
@ OS_CREATE_QUEUES
Definition: os.h:111
@ OS_INIT_PRE_OS
Definition: os.h:113
@ OS_SCHEDULER_RUNNING
Definition: os.h:114
@ OS_OFF
Definition: os.h:109
@ OS_INIT_OS_FATALERROR
Definition: os.h:119
@ OS_PRE_CYCLIC_INITIALIZATION_HAS_FINISHED
Definition: os.h:116
@ OS_ENGINE_RUNNING
Definition: os.h:115
@ OS_INIT_OS_FATALERROR_SCHEDULER
Definition: os.h:118
@ OS_SYSTEM_RUNNING
Definition: os.h:117
@ OS_BOOT_STATE_MAX
Definition: os.h:120
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:210
OS_STD_RETURN_e OS_NotifyIndexedFromIsr(TaskHandle_t taskToNotify, uint32_t indexToNotify, uint32_t notifiedValue)
Notify a task, with index.
Definition: os_freertos.c:230
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:154
void OS_InitializeOperatingSystem(void)
Initialization the RTOS interface.
Definition: os.c:84
void vApplicationIdleHook(void)
Hook function for the idle task.
Definition: os_freertos.c:124
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:150
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:277
void OS_InitializeScheduler(void)
Initialization function for the scheduler.
Definition: os_freertos.c:76
uint32_t OS_GetTickCount(void)
Returns OS based system tick value.
Definition: os_freertos.c:158
volatile OS_BOOT_STATE_e os_boot
Definition: os.c:74
struct for FreeRTOS task definition
Definition: os.h:135
uint32_t cycleTime
Definition: os.h:138
uint32_t stackSize_B
Definition: os.h:139
void * pvParameters
Definition: os.h:140
OS_PRIORITY_e priority
Definition: os.h:136
uint32_t phase
Definition: os.h:137
OS timer.
Definition: os.h:124
uint8_t timer_min
Definition: os.h:129
uint8_t timer_1ms
Definition: os.h:125
uint8_t timer_sec
Definition: os.h:128
uint8_t timer_100ms
Definition: os.h:127
uint8_t timer_10ms
Definition: os.h:126
uint8_t timer_h
Definition: os.h:130
uint16_t timer_d
Definition: os.h:131