Skip to content

Commit c6380c2

Browse files
committed
remove LSI clock for WakUp RF capability as the variant has already set LSE
1 parent 58e3c73 commit c6380c2

File tree

1 file changed

+18
-6
lines changed

1 file changed

+18
-6
lines changed

src/utility/HCISharedMemTransport.cpp

+18-6
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ static void evt_received(TL_EvtPacket_t *hcievt)
9090

9191
#if defined(DEBUG)
9292
#if defined(PRINT_HCI_DATA)
93-
printf("RX<< BLE EVT : ");
93+
printf("RX<< EVT : ");
9494
printf(" Type %#x", hcievt->evtserial.type);
9595
printf(" evt %#x", hcievt->evtserial.evt.evtcode);
9696
printf(" Len %#d", hcievt->evtserial.evt.plen);
@@ -171,6 +171,19 @@ __disable_irq();
171171
__enable_irq();
172172
break;
173173
case TL_ACL_DATA_PKT_TYPE: {
174+
#if defined(DEBUG)
175+
#if defined(PRINT_HCI_DATA)
176+
printf("RX<< ACL : ");
177+
printf(" Type %#x", hcievt->evtserial.type);
178+
printf(" evt %#x", hcievt->evtserial.evt.evtcode);
179+
printf(" Len %#d", hcievt->evtserial.evt.plen);
180+
printf(" :");
181+
for (uint8_t i = 0; i < hcievt->evtserial.evt.plen; i++) {
182+
printf(" %02X", hcievt->evtserial.evt.payload[i]);
183+
}
184+
printf("\r\n");
185+
#endif /* PRINT_HCI_DATA */
186+
#endif /* DEBUG */
174187
TL_AclDataSerial_t *acl = &(((TL_AclDataPacket_t *)hcievt)->AclDataSerial);
175188
len = acl->length + 5;
176189
memcpy((uint8_t *)&_rxbuff[_write_index], (uint8_t *)&acl, len);
@@ -495,13 +508,12 @@ HAL_RTCEx_EnableBypassShadow(&hrtc);
495508
LL_RCC_ReleaseBackupDomainReset();
496509
}
497510

498-
LL_RCC_LSI2_Enable();
499-
while (!LL_RCC_LSI2_IsReady()) {
500-
}
511+
/* Switch OFF LSI */
512+
LL_RCC_LSI2_Disable();
501513

502514
/* Select wakeup source of BLE RF */
503-
LL_RCC_SetRFWKPClockSource(LL_RCC_RFWKP_CLKSOURCE_LSI);
504-
LL_RCC_SetRTCClockSource(LL_RCC_RTC_CLKSOURCE_LSI);
515+
LL_RCC_SetRFWKPClockSource(LL_RCC_RFWKP_CLKSOURCE_LSE);
516+
505517
}
506518

507519
void stm32wb_reset(void)

0 commit comments

Comments
 (0)