正常使用时没问题,使用OTA升级工具时连接蓝牙或者点击GETINFO后板子就变成砖了,得重新用usb刷代码,以下是部分改动,跟这部分有关系吗
case GAPROLE_CONNECTED:
{
gapEstLinkReqEvent_t *event = (gapEstLinkReqEvent_t *)pEvent;
uint16_t conn_interval = 0;
//conn_interval = event->connInterval;
if(pEvent->gap.opcode == GAP_LINK_ESTABLISHED_EVENT)
{
Peripheral_LinkEstablished(pEvent);
GPIOA_SetBits(GPIO_Pin_8); //连接灯亮
GPIOB_ResetBits(GPIO_Pin_7);
PRINT("Connected..\n");
}
if(conn_interval > DEFAULT_DESIRED_MAX_CONN_INTERVAL)
{
PRINT("Send Update\r\n");
GAPRole_PeripheralConnParamUpdateReq(event->connectionHandle,
DEFAULT_DESIRED_MIN_CONN_INTERVAL,
DEFAULT_DESIRED_MAX_CONN_INTERVAL,
DEFAULT_DESIRED_SLAVE_LATENCY,
DEFAULT_DESIRED_CONN_TIMEOUT,
Peripheral_TaskID);
}
break;
}
case GAPROLE_CONNECTED_ADV:
PRINT("Connected Advertising..\n");
break;
case GAPROLE_WAITING:
{
if(pEvent->gap.opcode == GAP_LINK_TERMINATED_EVENT)
{
Peripheral_LinkTerminated(pEvent);
GPIOA_ResetBits(GPIO_Pin_8); //断开连接灯灭
GPIOB_SetBits(GPIO_Pin_7);
loadch = false;
startadc = false;
fdeltch = false;
chageload = false;
noload = false;
PRINT("Disconnected.. Reason:%x\n", pEvent->linkTerminate.reason);
}
}