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

Loading...
Searching...
No Matches
os_watchdog.c
1
2#include "os_config.h"
3#if OS_FEATURE_WATCHDOG_ENABLED == 1
4
5#if OS_USE_MCC_WATCHDOG == 1
6#include "xc.h" //workaround, mcc watchdog driver does not include that!
7#include "system/watchdog.h"
8#else
9
10//-------------------------------------------------------------------------------------------------------
11// FWDT
12//#pragma config RWDTPS = PS2048 // ==> 1,95 sec
13//#pragma config RCLKSEL = LPRC // Watchdog Timer Clock Select bits (Always use LPRC)
14//#pragma config WINDIS = ON // Watchdog Timer Window Enable bit (Watchdog Timer operates in Non-Window mode)
15//#pragma config WDTWIN = WIN25 // Watchdog Timer Window Select bits (WDT Window is 25% of WDT period)
16//#pragma config SWDTPS = PS1048576 // Sleep Mode Watchdog Timer Post Scaler select bits (1:1048576)
17//#pragma config FWDTEN = ON // Watchdog Timer Enable bit (WDT enabled in hardware)
18
19#endif
20
21/* The functions in this file write to registers that are related to the
22 WatchDog Timer, and hence a return is not required */
23/* LDRA_EXCLUDE 65 D */
24void OS_Watchdog_Init(void)
25{
26#if OS_USE_MCC_WATCHDOG == 1
27 WATCHDOG_TimerClear();
28 WATCHDOG_TimerSoftwareEnable();
29#endif
30}
31
32/* 61 D reports that the function needs to be declared static because as per
33 76 D the function is not called in the code being analyzed */
34/* LDRA_EXCLUDE 61 D */
35/* LDRA_EXCLUDE 76 D */
36/* LDRA_EXCLUDE 65 D */
37void OS_Watchdog_Enable(void)
38{
39#if OS_USE_MCC_WATCHDOG == 1
40 WATCHDOG_TimerSoftwareEnable();
41#endif
42}
43
44/* LDRA_EXCLUDE 61 D */
45/* LDRA_EXCLUDE 76 D */
46/* LDRA_EXCLUDE 65 D */
47void OS_Watchdog_Disable(void)
48{
49#if OS_USE_MCC_WATCHDOG == 1
50 WATCHDOG_TimerSoftwareDisable();
51#endif
52}
53
54/* LDRA_EXCLUDE 65 D */
55void OS_Watchdog_KeepAlivePing(void)
56{
57#if OS_USE_MCC_WATCHDOG == 1
58 WATCHDOG_TimerClear();
59#endif
60}
61
62#endif
WATCHDOG_TimerClear
static void WATCHDOG_TimerClear(void)
This inline function is used to clear the Watchdog Timer (WDT)
Definition watchdog.h:78
WATCHDOG_TimerSoftwareDisable
static void WATCHDOG_TimerSoftwareDisable(void)
This inline function is used to disable the Watchdog Timer (WDT) using the software bit.
Definition watchdog.h:67
WATCHDOG_TimerSoftwareEnable
static void WATCHDOG_TimerSoftwareEnable(void)
This inline function is used to enable the Watchdog Timer (WDT) using the software bit.
Definition watchdog.h:56