微波EDA网,见证研发工程师的成长!
首页 > 研发问答 > 无线和射频 > TI蓝牙设计交流 > CC2650 WATCHDOG 不能使用?

CC2650 WATCHDOG 不能使用?

时间:10-02 整理:3721RD 点击:

最近在使用cc2650 launchpad 开发板,遇到WATCHDOG 不能使用,集体代码如下

INT_WATCHDOG=1000 //参考cc2540

Board_WATCHDOG=0

/*!
* @def CC2650_WatchdogName
* @brief Enum of Watchdogs on the CC2650 dev board
*/
typedef enum CC2650_WatchdogName {
CC2650_WATCHDOG0 = 0,
CC2650_WATCHDOGCOUNT
} CC2650_WatchdogName;

/*!
* @def SENSORTAG_CC2650_WatchdogName
* @brief Enum of Watchdogs on the SENSORTAG_CC2650 dev board
*/
typedef enum SENSORTAG_CC2650_WatchdogName {
SENSORTAG_CC2650_WATCHDOG0 = 0,
SENSORTAG_CC2650_WATCHDOGCOUNT
} SENSORTAG_CC2650_WatchdogName;

/* Watchdog objects */
WatchdogCC26XX_Object watchdogCC26XXObjects[SENSORTAG_CC2650_WATCHDOGCOUNT];

/* Watchdog configuration structure */
const WatchdogCC26XX_HWAttrs watchdogCC26XXHWAttrs[SENSORTAG_CC2650_WATCHDOGCOUNT] = {
/* SENSORTAG_CC2650_WATCHDOG0 with 1 sec period at default CPU clock freq */
{WDT_BASE, INT_WATCHDOG},
};

const Watchdog_Config Watchdog_config[] = {
{&WatchdogCC26XX_fxnTable, &watchdogCC26XXObjects[0], &watchdogCC26XXHWAttrs[0]},
{NULL, NULL, NULL},
};

static void wdtCallback(UArg handle);
static void wdtInitFxn();
static Watchdog_Handle watchdog_led_handle;

static void wdtCallback(UArg handle)
{
Watchdog_clear((Watchdog_Handle)handle);
}
static void wdtInitFxn()
{
Watchdog_Params wp;
Watchdog_Handle watchdog;
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 tickValue = 750000; //24MK/32
tickValue = Watchdog_convertMsToTicks(watchdog, 1000); //设置超时期限为1000毫秒
Watchdog_setReload(watchdog, tickValue);
watchdog_led_handle = watchdog;
return ;
}

代码主要是参考一些链接编程

参考:http://blog.csdn.net/zzfenglin/article/details/52253536 

求大神指导,谢谢

您可以参考下E2E上的相关代码 

https://e2e.ti.com/support/wireless_connectivity/bluetooth_low_energy/f/538/t/440356

Copyright © 2017-2020 微波EDA网 版权所有

网站地图

Top