Skip to content

Commit

Permalink
stm32: Fix setting USB clock with USB to CANbus mode on stm32g4/stm32l4
Browse files Browse the repository at this point in the history
Signed-off-by: Kevin O'Connor <[email protected]>
  • Loading branch information
KevinOConnor committed Aug 30, 2024
1 parent 81de9a8 commit f71d2c7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/stm32/stm32g4.c
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ enable_clock_stm32g4(void)
RCC->CR |= RCC_CR_PLLON;

// Enable 48Mhz USB clock using clock recovery
if (CONFIG_USBSERIAL) {
if (CONFIG_USB) {
RCC->CRRCR |= RCC_CRRCR_HSI48ON;
while (!(RCC->CRRCR & RCC_CRRCR_HSI48RDY))
;
Expand Down
2 changes: 1 addition & 1 deletion src/stm32/stm32l4.c
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ enable_clock_stm32l4(void)
RCC->CR |= RCC_CR_PLLON;

// Enable 48Mhz USB clock using clock recovery
if (CONFIG_USBSERIAL) {
if (CONFIG_USB) {
RCC->CRRCR |= RCC_CRRCR_HSI48ON;
while (!(RCC->CRRCR & RCC_CRRCR_HSI48RDY))
;
Expand Down

0 comments on commit f71d2c7

Please sign in to comment.