update 1.8
This commit is contained in:
@@ -22,7 +22,6 @@
|
||||
void NMI_Handler(void) __attribute__((interrupt("WCH-Interrupt-fast")));
|
||||
void HardFault_Handler(void) __attribute__((interrupt("WCH-Interrupt-fast")));
|
||||
void BB_IRQHandler(void) __attribute__((interrupt("WCH-Interrupt-fast")));
|
||||
void LLE_IRQHandler(void) __attribute__((interrupt("WCH-Interrupt-fast")));
|
||||
|
||||
/*********************************************************************
|
||||
* @fn NMI_Handler
|
||||
@@ -60,15 +59,3 @@ void BB_IRQHandler(void)
|
||||
{
|
||||
BB_IRQLibHandler();
|
||||
}
|
||||
|
||||
/*********************************************************************
|
||||
* @fn LLE_IRQHandler
|
||||
*
|
||||
* @brief LLE Interrupt for BLE.
|
||||
*
|
||||
* @return None
|
||||
*/
|
||||
void LLE_IRQHandler(void)
|
||||
{
|
||||
LLE_IRQLibHandler();
|
||||
}
|
||||
|
||||
@@ -237,12 +237,6 @@ static void ObserverEventCB(gapRoleEvent_t *pEvent)
|
||||
|
||||
case GAP_EXT_ADV_DEVICE_INFO_EVENT:
|
||||
{
|
||||
PRINT("periodicAdvInterval %d...\n",pEvent->deviceExtAdvInfo.periodicAdvInterval);
|
||||
PRINT("addr %x %x %x %x %x %x...\n",pEvent->deviceExtAdvInfo.addr[0],
|
||||
pEvent->deviceExtAdvInfo.addr[1],pEvent->deviceExtAdvInfo.addr[2],
|
||||
pEvent->deviceExtAdvInfo.addr[3],pEvent->deviceExtAdvInfo.addr[4],
|
||||
pEvent->deviceExtAdvInfo.addr[5]
|
||||
);
|
||||
if(tmos_memcmp(PeerAddrDef, pEvent->deviceExtAdvInfo.addr, B_ADDR_LEN) &&
|
||||
pEvent->deviceExtAdvInfo.periodicAdvInterval != 0)
|
||||
{
|
||||
@@ -251,14 +245,17 @@ static void ObserverEventCB(gapRoleEvent_t *pEvent)
|
||||
|
||||
tmos_memcpy(sync.addr, PeerAddrDef, B_ADDR_LEN);
|
||||
sync.addrType = pEvent->deviceExtAdvInfo.addrType;
|
||||
sync.advertising_SID = 8;
|
||||
sync.advertising_SID = pEvent->deviceExtAdvInfo.advertisingSID;
|
||||
sync.options = DUPLICATE_FILTERING_INITIALLY_ENABLED;
|
||||
sync.syncTimeout = 80; // 800ms
|
||||
sync.syncTimeout = (pEvent->deviceExtAdvInfo.periodicAdvInterval * 6 + 7) / 8; //6 times the periodicAdvInterval
|
||||
|
||||
/* Only one sync can be established at the same time for now */
|
||||
state = GAPRole_CreateSync(&sync);
|
||||
|
||||
PRINT("GAPRole_CreateSync %d return %d...\n ", pEvent->deviceExtAdvInfo.periodicAdvInterval, state);
|
||||
if (state == SUCCESS) {
|
||||
tmos_start_task(ObserverTaskId, START_SYNC_TIMEOUT_EVT, DEFAULT_CREAT_SYNC_TIMEOUT);
|
||||
}
|
||||
}
|
||||
}
|
||||
PRINT("GAP_EXT_ADV_DEVICE_INFO_EVENT...\n");
|
||||
}
|
||||
@@ -279,7 +276,11 @@ static void ObserverEventCB(gapRoleEvent_t *pEvent)
|
||||
|
||||
case GAP_PERIODIC_ADV_DEVICE_INFO_EVENT:
|
||||
{
|
||||
PRINT("periodic adv - len %d, data[5] %x...\n", pEvent->devicePeriodicInfo.dataLength, pEvent->devicePeriodicInfo.pEvtData[5]);
|
||||
PRINT("periodic adv - len %d (", pEvent->devicePeriodicInfo.dataLength);
|
||||
for (int i = 0 ; i < pEvent->devicePeriodicInfo.dataLength; i++) {
|
||||
PRINT(" %#x", pEvent->devicePeriodicInfo.pEvtData[i]);
|
||||
}
|
||||
PRINT(" )\n");
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
@@ -53,6 +53,7 @@ void Main_Circulation(void)
|
||||
*/
|
||||
int main(void)
|
||||
{
|
||||
SystemCoreClockUpdate();
|
||||
Delay_Init();
|
||||
#ifdef DEBUG
|
||||
USART_Printf_Init( 115200 );
|
||||
|
||||
Reference in New Issue
Block a user