1 使能WDT_IN_PM1
2 在main函數的下面位置處開啓
#ifdef WDT_IN_PM1
/* If WDT is used, this is a good place to enable it. */
WatchDogEnable( WDTIMX );
//設置開門模式,間隔1s
WDCTL = 0x00;
WDCTL = 0x08;
#endif
3 在主循環中喂狗
for(;;) // Forever Loop
#endif
{
osal_run_system();
//喂狗
WDCTL = 0xA0;
WDCTL = 0x50;
}
參考文章:
http://www.deyisupport.com/question_answer/wireless_connectivity/zigbee/f/104/t/84884.aspx