TI中文支持网
TI专业的中文技术问题搜集分享网站

CC2642 如何打开看门狗?

SDK: simplelink_cc13x2_26x2_sdk_3_20_00_68

Project: simple_central

有没有相关宏?

Alvin Chen:

参考SDK里面的driver 自行添加:
C:\ti\simplelink_cc13x2_26x2_sdk_3_20_00_68\examples\rtos\CC26X2R1_LAUNCHXL\drivers\watchdog

one Man:

回复 Alvin Chen:

你好,我参照例程将代码移植到我的工程里面,代码如下:

static Watchdog_Handle watchdogHandle;static void watchdogCallback(uintptr_t handle);static void watchdogCallback(uintptr_t handle)
{//Feed dogWatchdog_clear(watchdogHandle);
}void wdtInitFxn()
{Watchdog_Params params;uint32_treloadValue=0;Watchdog_init();/* Open a Watchdog driver instance */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 */TRACE_DEBUG("Watchdog_open error!");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, 1000);/** 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);}
}

请问可以在static void watchdogCallback(uintptr_t handle)中喂狗吗?

有时候看门狗不能复位CC2642。

one Man:

回复 Alvin Chen:

谢谢

赞(0)
未经允许不得转载:TI中文支持网 » CC2642 如何打开看门狗?
分享到: 更多 (0)