File tree Expand file tree Collapse file tree 2 files changed +12
-0
lines changed
Expand file tree Collapse file tree 2 files changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -366,6 +366,9 @@ int main(void) {
366366
367367 #if MICROPY_HW_ENABLE_USBDEV
368368 mp_usbd_init ();
369+ #if USB_CFG_LDO_REGULATOR == USB_CFG_ENABLE
370+ mp_hal_usb_set_vdcen ();
371+ #endif
369372 #endif
370373
371374 if (boot_res == BOARDCTRL_GOTO_SOFT_RESET_EXIT ) {
Original file line number Diff line number Diff line change @@ -64,6 +64,15 @@ static inline void mp_hal_wake_main_task_from_isr(void) {
6464 // Defined for tinyusb support, nothing needs to be done here.
6565}
6666
67+ #if USB_CFG_LDO_REGULATOR == USB_CFG_ENABLE
68+ #include "r_ioport.h"
69+
70+ static inline void mp_hal_usb_set_vdcen (void ) {
71+ // Set VDCEN bit to enable USB LDO regulator
72+ R_USB_FS0 -> USBMC = (R_USB_FS0_USBMC_VDCEN_Msk );
73+ }
74+ #endif
75+
6776// timing functions
6877
6978#include "irq.h"
You can’t perform that action at this time.
0 commit comments