Skip to content

Commit

Permalink
update(port/dwc2/usb_glue_at): import system_core_clock
Browse files Browse the repository at this point in the history
  • Loading branch information
sakumisu committed Dec 16, 2024
1 parent 05b46c8 commit effee4d
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions port/dwc2/usb_glue_at.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
#include "stdint.h"
#include "usb_dwc2_reg.h"

extern unsigned int system_core_clock;

uint32_t SystemCoreClock;
/* you can find this config in function: usb_global_init, file:at32fxxx_usb.c, for example:
*
* usbx->gccfg_bit.pwrdown = TRUE;
Expand All @@ -17,6 +20,7 @@

uint32_t usbd_get_dwc2_gccfg_conf(uint32_t reg_base)
{
SystemCoreClock = system_core_clock;
#ifdef CONFIG_USB_HS
return ((1 << 16) | (1 << 21));
#else
Expand All @@ -35,6 +39,7 @@ uint32_t usbd_get_dwc2_gccfg_conf(uint32_t reg_base)

uint32_t usbh_get_dwc2_gccfg_conf(uint32_t reg_base)
{
SystemCoreClock = system_core_clock;
#ifdef CONFIG_USB_HS
return ((1 << 16) | (1 << 21));
#else
Expand Down

0 comments on commit effee4d

Please sign in to comment.