关于CC2640 2.1的SDK问题
我在2.0的SDK使用外部IO口中断正常,但是我在2.1的SDK中使用相同的代码则会复位,代码如下:
static PIN_State PasswordPins;
static PIN_Handle hPasswordPins;
static void GPIORESETCallback(PIN_Handle hPin, PIN_Id pinId);
void Board_RESETGPIO(void)
{
hPasswordPins = PIN_open(&PasswordPins, PasswordPinsCfg);
PIN_registerIntCb(hPasswordPins, GPIORESETCallback);
PIN_setConfig(hPasswordPins, PIN_BM_IRQ, Board_RESET | PIN_IRQ_NEGEDGE);
#ifdef POWER_SAVING
//Enable wakeup
PIN_setConfig(hPasswordPins, PINCC26XX_BM_WAKEUP, Board_RESET | PINCC26XX_WAKEUP_NEGEDGE);
#endif
}
static void GPIORESETCallback(PIN_Handle hPin, PIN_Id pinId)
{
switch(pinId)
{
case Board_RESET:
{
CPUdelay(8000*30);/* Wait a bit - about 40 ms */
if ( PIN_getInputValue(Board_RESET) == 0 )
{
memcpy(SystemParameter.Password,"111111",6);
write_uart("reset\r\n",7);
CPUdelay(8000*1);
osal_snv_write(BLE_DEVICE_DATA_SAVE,sizeof(SystemParameter),&SystemParameter);
CPUdelay(8000*3);
}
break;
}
default:
break;
}
}
我测试了很多次都是如此,实在是找不到问题,请帮忙确认,谢谢!
haibin,
具体是怎么样的情况下会复位呢?
有连接?没连接?还是裸跑PIN的驱动?