23 #include "../watchdog_int.h"
27 #include "inc/hw_ints.h"
28 #include "inc/hw_memmap.h"
29 #include "inc/hw_types.h"
30 #include "driverlib/sysctl.h"
31 #include "driverlib/interrupt.h"
32 #include "driverlib/gpio.h"
33 #include "driverlib/timer.h"
36 void Timer0IntHandler(
void)
39 TimerIntClear(TIMER0_BASE, TIMER_TIMA_TIMEOUT);
43 void setupwatchdoginterrupt(
void)
45 unsigned long ulPeriod;
46 SysCtlPeripheralEnable(SYSCTL_PERIPH_TIMER0);
47 while (!SysCtlPeripheralReady(SYSCTL_PERIPH_TIMER0)) {}
48 TimerConfigure(TIMER0_BASE, TIMER_CFG_PERIODIC);
49 ulPeriod = (SysCtlClockGet() / 4) ;
51 TimerLoadSet(TIMER0_BASE, TIMER_A, ulPeriod-1);
52 TimerIntRegister(TIMER0_BASE,TIMER_A,Timer0IntHandler);
53 TimerIntEnable(TIMER0_BASE, TIMER_TIMA_TIMEOUT);
54 TimerEnable(TIMER0_BASE, TIMER_A);