wdg.c
#include "Bsp.h"
#include "wdg.h"
#define REL_VAL_BASE 0xFFFF /* Reload value for extended timeout window */
#define WAIT_TIME 1000 /* Number of milliseconds to wait */
void wdg_init(float time)
{
/*IfxScuWdt_disableCpuWatchdog(IfxScuWdt_getCpuWatchdogPassword());*/ /* Set CPU0 WD timer active */
IfxScuWdt_disableSafetyWatchdog(IfxScuWdt_getSafetyWatchdogPassword()); /* Safety WD remains disabled */
sint16 value=REL_VAL_BASE - (time * 6103.515625);
IfxScuWdt_changeCpuWatchdogReload(IfxScuWdt_getCpuWatchdogPassword(), value); /* Set CPU0WD timer to ~1.3 sec */
IfxScuWdt_serviceCpuWatchdog(IfxScuWdt_getCpuWatchdogPassword()); /* Service the CPU0WDT */
}
void feed_dog()
{
IfxScuWdt_serviceCpuWatchdog(IfxScuWdt_getCpuWatchdogPassword()); /* Continuously service CPU0WDT */
}
wdg.h
#ifndef BSP_WDG_WDG_H_
#define BSP_WDG_WDG_H_
void feed_dog();
void wdg_init(float time);
#endif /* BSP_WDG_WDG_H_ */