Skip to content

Commit 9849b46

Browse files
committed
remove LSI clock for WakeUp RF capability as the variant has already set LSE
Signed-off-by: Francois Ramu <[email protected]>
1 parent cb47366 commit 9849b46

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
@@ -88,7 +88,7 @@ static void evt_received(TL_EvtPacket_t *hcievt)
8888

8989
#if defined(DEBUG)
9090
#if defined(PRINT_HCI_DATA)
91-
printf("RX<< BLE EVT : ");
91+
printf("RX<< EVT : ");
9292
printf(" Type %#x", hcievt->evtserial.type);
9393
printf(" evt %#x", hcievt->evtserial.evt.evtcode);
9494
printf(" Len %#d", hcievt->evtserial.evt.plen);
@@ -159,6 +159,19 @@ __disable_irq();
159159
__enable_irq();
160160
break;
161161
case TL_ACL_DATA_PKT_TYPE: {
162+
#if defined(DEBUG)
163+
#if defined(PRINT_HCI_DATA)
164+
printf("RX<< ACL : ");
165+
printf(" Type %#x", hcievt->evtserial.type);
166+
printf(" evt %#x", hcievt->evtserial.evt.evtcode);
167+
printf(" Len %#d", hcievt->evtserial.evt.plen);
168+
printf(" :");
169+
for (uint8_t i = 0; i < hcievt->evtserial.evt.plen; i++) {
170+
printf(" %02X", hcievt->evtserial.evt.payload[i]);
171+
}
172+
printf("\r\n");
173+
#endif /* PRINT_HCI_DATA */
174+
#endif /* DEBUG */
162175
TL_AclDataSerial_t *acl = &(((TL_AclDataPacket_t *)hcievt)->AclDataSerial);
163176
__disable_irq();
164177
len = acl->length + 5;
@@ -461,13 +474,12 @@ size_t HCISharedMemTransportClass::write(const uint8_t* data, size_t length)
461474
LL_RCC_ReleaseBackupDomainReset();
462475
}
463476

464-
LL_RCC_LSI2_Enable();
465-
while (!LL_RCC_LSI2_IsReady()) {
466-
}
477+
/* Switch OFF LSI */
478+
LL_RCC_LSI2_Disable();
467479

468480
/* Select wakeup source of BLE RF */
469-
LL_RCC_SetRFWKPClockSource(LL_RCC_RFWKP_CLKSOURCE_LSI);
470-
LL_RCC_SetRTCClockSource(LL_RCC_RTC_CLKSOURCE_LSI);
481+
LL_RCC_SetRFWKPClockSource(LL_RCC_RFWKP_CLKSOURCE_LSE);
482+
471483
}
472484

473485
void stm32wb_reset(void)

0 commit comments

Comments
 (0)