|  | Dual Active Bridge Development Board (Part-No. ) |
Content |  |  |  |  |  |

Loading...
Searching...
No Matches
os.c
1
2//=======================================================================================================
3// @file os/os.c
4//
5// @brief contains the init function of the operating system and calls all the other Init functions
6//
7// @version v1.0
8// @date 2019-23-12
9// @author M52409
10//
11//=======================================================================================================
12
13#include "os/os_scheduler.h"
14#include "os/os.h"
15#include "stdint.h"
16
17#if OS_FEATURE_WATCHDOG_ENABLED == true
18#include "os_watchdog.h"
19#endif
20
21#ifndef OS_TIMER_NUMBER_OF_TIMERS
22#warning OS_TIMER_NUMBER_OF_TIMERS needs to be defined in main/project_setting.h
23#endif
24#ifndef OS_USE_SYSTIME
25#warning OS_USE_SYSTIME needs to be defined in main/project_setting.h
26#endif
27
28#if OS_TIMER_NUMBER_OF_TIMERS > 0
29#include"os/os_timer.h"
30#endif
31
32
33//=======================================================================================================
34// @brief Initializes Scheduler
35// @note call this function in your main routine before calling the RunForever function
36//=======================================================================================================
37void OS_Init(void)
38{
39/* LDRA_EXCLUDE 337 S */
40#if OS_RESETTHINGY == 1
41 if (RCONbits.WDTO)
42 os_resetCause |= 1 << OS_RESETCAUSE_WATCHDOG;
43 RCON = 0;
44#endif
45
46#if OS_FEATURE_WATCHDOG_ENABLED == 1
47 OS_Watchdog_Init();
48#endif
49
50 OS_Scheduler_Init();
51#if OS_TIMER_NUMBER_OF_TIMERS > 0
52 OS_Timer_Init();
53#endif
54}
55