在z-stack中開啓看門狗

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

http://blog.sina.com.cn/s/blog_5082ba3701012ky4.html

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章