Other Parts Discussed in Thread: SIMPLELINK-CC2640R2-SDK, BLE-STACK
Tool/software: TI-RTOS
Hi, TI enginner,
I am working on watchdog timer with BLE-STACK V3.0.1 (Support for CC2640R2F)(SIMPLELINK-CC2640R2-SDK_1.40.00.45)(20 Jul 2017)
Please see my question in yellow background.
Here are my key codes:
#define Board_WATCHDOG CC2640R2_LAUNCHXL_WATCHDOG0
Watchdog_Handle watchdog;
static void wdtCallback(UArg handle)
{
Watchdog_clear((Watchdog_Handle)handle);//********never run, why? *********
}
static void wdtInitFxn(void)
{
Watchdog_init();
Watchdog_Params wp;
Watchdog_Params_init(&wp);
wp.callbackFxn = wdtCallback;
wp.debugStallMode = Watchdog_DEBUG_STALL_ON;
wp.resetMode = Watchdog_RESET_ON;
watchdog = Watchdog_open(Board_WATCHDOG, &wp);
uint32_t ticks = Watchdog_convertMsToTicks( watchdog, EXP_TIME);////****** if I want to expire after 1s, I have to set EXP_TIME to 1000/50, why? ***********
Watchdog_setReload(watchdog, ticks);
}
So I have to run the dog feed function in task funciton:
static void simpleBLE_taskFxn(UArg a0, UArg a1)
{
simpleBLE_init();
for (;;)
{
events = Event_pend(syncEvent, Event_Id_NONE, MR_ALL_EVENTS,
ICALL_TIMEOUT_FOREVER);
if (events)
{
.......
}
Watchdog_clear(watchdog);//********it can run*********
}
Thanks!
Charles Bai.
