|
@@ -1,6 +1,7 @@
|
|
|
|
|
|
|
|
//#include "ti/driverlib/dl_timer.h"
|
|
//#include "ti/driverlib/dl_timer.h"
|
|
|
//#include "ti/driverlib/dl_wwdt.h"
|
|
//#include "ti/driverlib/dl_wwdt.h"
|
|
|
|
|
+#include "ti/driverlib/dl_wwdt.h"
|
|
|
#include "ti/driverlib/m0p/dl_core.h"
|
|
#include "ti/driverlib/m0p/dl_core.h"
|
|
|
#include "ti_msp_dl_config.h"
|
|
#include "ti_msp_dl_config.h"
|
|
|
#include "src/pi/i2c_pi_target.h"
|
|
#include "src/pi/i2c_pi_target.h"
|
|
@@ -82,35 +83,18 @@ void I2C_0_INST_IRQHandler(void)
|
|
|
break;
|
|
break;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
-/*Timer feeds the WWDT. the initialization of the Timer is done in the config.h file
|
|
|
|
|
-Timer is configured to reset the watchdog timer periodically.
|
|
|
|
|
-LFCLK is sourced from the internal low frequency oscilloscope.
|
|
|
|
|
-The device remains in STANDBY mode while waiting for an interrupt
|
|
|
|
|
-*/
|
|
|
|
|
-//interrupt added for Windows Watchdog Timer:
|
|
|
|
|
-void TIMER_0_INST_IRQHandler(void)
|
|
|
|
|
-{
|
|
|
|
|
- switch (DL_TimerG_getPendingInterrupt(TIMER_0_INST)) {
|
|
|
|
|
- case DL_TIMER_IIDX_ZERO:
|
|
|
|
|
- if (DL_WWDT_getPendingInterrupt(WWDT0)) {
|
|
|
|
|
- //Restart the WWDT peripheral:
|
|
|
|
|
- DL_WWDT_restart(WWDT0);
|
|
|
|
|
- //Set the flag to True
|
|
|
|
|
- watchdog_triggered= true;
|
|
|
|
|
- }
|
|
|
|
|
- default:
|
|
|
|
|
- break;
|
|
|
|
|
- }
|
|
|
|
|
-}
|
|
|
|
|
|
|
+
|
|
|
|
|
|
|
|
int main(void)
|
|
int main(void)
|
|
|
{
|
|
{
|
|
|
SYSCFG_DL_init();
|
|
SYSCFG_DL_init();
|
|
|
|
|
+ // initialize watchdog timer configuration
|
|
|
|
|
+ SYSCFG_DL_WWDT0_init();
|
|
|
|
|
+ // Enable WWDT after initialization:
|
|
|
|
|
+ DL_WWDT_enablePower(WWDT0);
|
|
|
Battery_Init();
|
|
Battery_Init();
|
|
|
//dynamic addressing function call for Pi
|
|
//dynamic addressing function call for Pi
|
|
|
dynamic_gpio_addressing();
|
|
dynamic_gpio_addressing();
|
|
|
- /* Enable WWDT interrupts on device */
|
|
|
|
|
- NVIC_EnableIRQ(WWDT0_INT_IRQN);
|
|
|
|
|
//Interrupt routine for Pi
|
|
//Interrupt routine for Pi
|
|
|
NVIC_EnableIRQ(I2C_0_INST_INT_IRQN);
|
|
NVIC_EnableIRQ(I2C_0_INST_INT_IRQN);
|
|
|
//Interrupt for target mcu
|
|
//Interrupt for target mcu
|