Announcements

Equip yourself to optimize PSoc4 MCUs for Evs at the EV Webinar. Click here to register.

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

PSoC™ 4 Forum Discussions

songzaiwu
Level 3
Level 3
10 questions asked 25 sign-ins 10 replies posted

  

void StackEventHandler(uint32 event, void* eventParam);
void IasEventHandler(uint32 event, void* eventParam);
void HandleAlertLEDs(uint8 status);

/*******************************************************************************/
int main()
{
CyGlobalIntEnable;

/* Start the BLE component and register StackEventHandler function */
CyBle_Start(StackEventHandler);

/* Start the PWM component */
PWM_Start();

/* Register IAS event handler function */
CyBle_IasRegisterAttrCallback(IasEventHandler);

while(1)
{
/* Process all the pending BLE tasks. This single API call to
* will service all the BLE stack events. This API MUST be called at least once
* in a BLE connection interval */
CyBle_ProcessEvents();
}
}

  这个 函数中 控制灯的 状态   void IasEventHandler(uint32 event, void* eventParam);

但是 循环中 没有调用   void IasEventHandler(uint32 event, void* eventParam);  那么为啥灯的状态可以变?

 

0 Likes
1 Solution

/* Register IAS event handler function */
CyBle_IasRegisterAttrCallback(IasEventHandler);

上面的function把IasEventHandler这个函数传递到CyBle_IasApplCallback。

然后在下面的function里执行的

CyBle_IassWriteCmdEventHandler

都是通过callback的方式调用的。

View solution in original post

0 Likes
3 Replies
Owen_Zhang123
Moderator
Moderator
Moderator
500 solutions authored 250 sign-ins 1000 replies posted

请问你用的是psoc6 ble的kit吗?是在哪个SDK上跑的demo?

0 Likes
songzaiwu
Level 3
Level 3
10 questions asked 25 sign-ins 10 replies posted

cy8ckt-042-ble 开发板

0 Likes

/* Register IAS event handler function */
CyBle_IasRegisterAttrCallback(IasEventHandler);

上面的function把IasEventHandler这个函数传递到CyBle_IasApplCallback。

然后在下面的function里执行的

CyBle_IassWriteCmdEventHandler

都是通过callback的方式调用的。

0 Likes