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
{
Alvin Chen:
你的程序是不是没有post 操作,导致卡住了,你仿试一下, Event_post(syncEvent, arg);
Alvin Chen:
回复 Alvin Chen:
如果你想不断的轮询你的IO可以考虑加一个taskFxn,Task_construct
Eggsy Pang:
不断检测IO 口,为什么不用中断?
shadowing Chen:
问题解决 ,没有start