This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

cc2640r2f simple_peripheral 里的task任务我改了下程序为什么不能循环输出只有当连接上以后才能循环输出,如下,如果这样不行我想在蓝牙广播期间不停检测IO口应该用什么方式呢?

static void SimpleBLEPeripheral_taskFxn(UArg a0, UArg a1)
{
/* APP任务初始化 */
int d;
d=1;
SimpleBLEPeripheral_init();
GPIO_init();
for (;;)
{
uint32_t events;
/* 获取事件 */
events = Event_pend(syncEvent, Event_Id_NONE, SBP_ALL_EVENTS,
ICALL_TIMEOUT_FOREVER);
d=d+1;////////////////////////////////////////////////////////////////////////////////就是这里我只能输出1次数字,在蓝牙没有连接之前这个d不会增加,为什么
Display_print1(dispHandle, 0, 0, "d: %x", d);
if (events)
{
ICall_EntityID dest;
ICall_ServiceEnum src;
ICall_HciExtEvt *pMsg = NULL;

/* 获取stack协议栈消息进行处理 */
if (ICall_fetchServiceMsg(&src, &dest,
(void **)&pMsg) == ICALL_ERRNO_SUCCESS)
{
uint8 safeToDealloc = TRUE;

if ((src == ICALL_SERVICE_CLASS_BLE) && (dest == selfEntity))
{
ICall_Stack_Event *pEvt = (ICall_Stack_Event *)pMsg;

// Check for BLE stack events first
if (pEvt->signature == 0xffff)
{
if (pEvt->event_flag & SBP_HCI_CONN_EVT_END_EVT)
{
// Try to retransmit pending ATT Response (if any)
SimpleBLEPeripheral_sendAttRsp();
}
}
else
{