你好,
目前開發環境如下:
SDK版本:simplelink_cc2640r2_sdk_1_35_00_33
晶片型號:CC2640R2FRGZ
在SimpleBLEPeripheral_init()中啟用,
在SimpleBLEPeripheral_taskFxn()中的for(;;)踢狗,
程式碼如下,
static void SimpleBLEPeripheral_init(void)
{// ******************************************************************// N0 STACK API CALLS CAN OCCUR BEFORE THIS CALL TO ICall_registerApp// ******************************************************************// Register the current thread as an ICall dispatcher application// so that the application can send and receive messages.ICall_registerApp(&selfEntity, &syncEvent);...Board_initWatchdog();Watchdog_Params_init(¶ms);params.resetMode = Watchdog_RESET_ON;
// params.callbackFxn = UserCallbackFxn;hWdt = Watchdog_open(Board_WATCHDOG0, ¶ms);if (hWdt == NULL) {// Error opening watchdogfor (;;){}}...
}
/*********************************************************************
* @fnSimpleBLEPeripheral_taskFxn
*
* @briefApplication task entry point for the Simple BLE Peripheral.
*
* @parama0, a1 - not used.
*
* @return None.
*/
static void SimpleBLEPeripheral_taskFxn(UArg a0, UArg a1)
{// Initialize applicationSimpleBLEPeripheral_init();// Application main loopfor (;;){uint32_t events;// Waits for an event to be posted associated with the calling thread.// Note that an event associated with a thread is posted when a// message is queued to the message receive queue of the threadevents = Event_pend(syncEvent, Event_Id_NONE, SBP_ALL_EVENTS,ICALL_TIMEOUT_FOREVER);Watchdog_clear(hWdt);...}
}
當系統的工作只剩下藍芽廣播,
其他定時器相關的事情都不動作的時候,
系統會進入休眠模式,
這時候看門狗應該也會進入休眠,
Q1 : 當系統要執行藍芽廣播時, 是否會短暫離開休眠模式並且讓看門狗也短暫醒來?
Q2 : 如果會的話, 要如何在這段時間餵狗以避免長時間造成系統重啟?
da qin zheng sheng:
比如你看门狗设置5秒钟复位,工作2秒后,芯片进入低功耗睡眠了3秒钟,
唤醒后还要等三秒钟才可能复位的。低功耗睡眠时间不算,因为此时看门狗停止工作!
da qin zheng sheng:
回复 da qin zheng sheng:
唤醒后看门狗应该自动工作的。
David Hsueh:
回复 da qin zheng sheng:
你好,
我的理解是當系統休眠時,
仍然可以做廣播的動作,
但執行完藍芽訊號的發送和接收後,
如果沒有發現連線的請求,
則系統自動會回去休眠狀態,
另外, 我的餵狗時機是在Event_pend(…)之後,
藍芽廣播的這個動作應該不會執行到餵狗這段代碼,我有疑惑的部分是,
上面這個廣播的動作,
是否會造成看門狗短暫的喚醒並且計數 ?
所以如果會的話, 這樣是不是會經過一段時間累積後, 看門狗溢出引發自動重啟?
Viki Shi:
回复 David Hsueh:
“我的理解是當系統休眠時,仍然可以做廣播的動作,”
系统休眠时不会广播,广播完成后进入休眠,在下一次需要广播时唤醒
TI中文支持网


