哪位大侠能否告诉我TI BLE SensorTag中传感器事件是如何触发的? 程序如下:uint16 SensorTag_ProcessEvent( uint8 task_id, uint16 events )
{
VOID task_id; // OSAL required parameter that isn't used in this function
// events = events|ST_GYROSCOPE_SENSOR_EVT;
if ( events & SYS_EVENT_MSG )
{
uint8 *pMsg;
if ( (pMsg = osal_msg_receive( sensorTag_TaskID )) != NULL )
{
sensorTag_ProcessOSALMsg( (osal_event_hdr_t *)pMsg );
// Release the OSAL message
VOID osal_msg_deallocate( pMsg );
}
// return unprocessed events
return (events ^ SYS_EVENT_MSG);
}
// Handle system reset (long press on side key)
if ( events & ST_SYS_RESET_EVT )
{
if (sysResetRequest)
{
HAL_SYSTEM_RESET();
}
return ( events ^ ST_SYS_RESET_EVT );
}
if ( events & ST_START_DEVICE_EVT )
{
// Start the Device
VOID GAPRole_StartDevice( &sensorTag_PeripheralCBs );
// Start Bond Manager
VOID GAPBondMgr_Register( &sensorTag_BondMgrCBs );
return ( events ^ ST_START_DEVICE_EVT );
}