如题,我知道在main函数中
#ifdef WDT_IN_PM1
/* If WDT is used, this is a good place to enable it. */
WatchDogEnable( WDTIMX );
#endif
在这里可以打开看门狗,那怎样喂狗呢?把喂狗写在哪里呢?如何在协议栈中能够不断的喂狗??
This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
如题,我知道在main函数中
#ifdef WDT_IN_PM1
/* If WDT is used, this is a good place to enable it. */
WatchDogEnable( WDTIMX );
#endif
在这里可以打开看门狗,那怎样喂狗呢?把喂狗写在哪里呢?如何在协议栈中能够不断的喂狗??
#define WD_KICK() st( WDCTL = (0xA0 | WDCTL & 0x0F); WDCTL = (0x50 | WDCTL & 0x0F); )
把watchdog timer溢出的时间设置为最大1s,然后把它加在下面
void osal_start_system( void )
{
#if !defined ( ZBIT ) && !defined ( UBIT )
for(;;) // Forever Loop
#endif
{
osal_run_system();
//feed watchdog
}
}