CC1310 看门狗怎么设置成直接超时复位模式



/* *  ======== 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(&params);    params.callbackFxn = (Watchdog_Callback) watchdogCallback;    params.debugStallMode = Watchdog_DEBUG_STALL_ON;    params.resetMode = Watchdog_RESET_ON;    watchdogHandle = Watchdog_open(Board_WATCHDOG0, &params);    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 */  

Viki Shi:

If reset is enabled in the Watchdog_Params and the Watchdog timer is allowed to time out again while the interrupt flag is still pending, a reset signal will be generated. To prevent a reset, Watchdog_clear() must be called to clear the interrupt flag and to reload the timer.

Since the device is not reset on the first Watchdog timeout, the maximum time lapse between the time when the device gets locked up and the time when it is reset can be up to two Watchdog timeout periods.


未经允许不得转载:TI中文支持网 » CC1310 看门狗怎么设置成直接超时复位模式
分享到: 更多 (0)