hi
看门狗要怎么设置才能超时时间到之后马上复位,而不是进回调?我的代码如下,如果我现在不喂狗,就一次进入watchdogCallback
/* * ======== watchdogCallback ======== */
void watchdogCallback(uintptr_t watchdogHandle)
{ /*
* If the Watchdog Non-Maskable Interrupt (NMI) is called,
* loop until the device resets. Some devices will invoke
* this callback upon watchdog expiration while others will
* reset. See the device specific watchdog driver documentation
* for your device. */
while (1)
{}
}
Watchdog_Handle watchdogHandle;
Watchdog_Params params;
uint32_t reloadValue; /* Call driver init functions */
Watchdog_init(); /* Configure the LED and button pins */
Watchdog_Params_init(¶ms);
params.callbackFxn = (Watchdog_Callback) watchdogCallback;
params.debugStallMode = Watchdog_DEBUG_STALL_ON;
params.resetMode = Watchdog_RESET_ON;
watchdogHandle = Watchdog_open(Board_WATCHDOG0, ¶ms);
if (watchdogHandle == NULL) { /* Error opening Watchdog */
while (1) {}
}
/* * The watchdog reload value is initialized during the
* Watchdog_open() call. The reload value can also be
* set dynamically during runtime.
* * Converts TIMEOUT_MS to watchdog clock ticks.
* This API is not applicable for all devices.
* See the device specific watchdog driver documentation
* for your device. */
reloadValue = Watchdog_convertMsToTicks(watchdogHandle, TIMEOUT_MS);
/* * A value of zero (0) indicates the converted value exceeds 32 bits
* OR that the API is not applicable for this specific device. */
if (reloadValue != 0) {
Watchdog_setReload(watchdogHandle, reloadValue);
} /* Turn on Board_GPIO_LED0 and enable Board_GPIO_BUTTON0 interrupt */