File tree Expand file tree Collapse file tree 4 files changed +18
-0
lines changed Expand file tree Collapse file tree 4 files changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -295,6 +295,8 @@ extern "C" {
295
295
}
296
296
297
297
__attribute__ ((weak)) void configure_usb_mux() {}
298
+ /* specific variant USB initialization should define this functiona in variant.cpp */
299
+ __attribute__ ((weak)) void usb_post_initialization() {}
298
300
299
301
void __USBStart () {
300
302
USBIrqCfg_t usb_irq_cfg;
@@ -361,6 +363,8 @@ void __USBStart() {
361
363
/* init device port*/
362
364
tud_init (BOARD_TUD_RHPORT);
363
365
366
+ usb_post_initialization ();
367
+
364
368
#ifdef VUSB_LDO_ENABLE
365
369
((R_USB_FS0_Type*)R_USB_FS0_BASE)->USBMC_b .VDCEN = 1 ;
366
370
#endif
Original file line number Diff line number Diff line change @@ -75,6 +75,11 @@ int32_t getPinIndex(bsp_io_port_pin_t p) {
75
75
76
76
#include " FspTimer.h"
77
77
78
+ void usb_post_initialization () {
79
+ ((R_USB_FS0_Type*)R_USB_FS0_BASE)->USBMC_b .VDCEN = 1 ;
80
+ }
81
+
82
+
78
83
void initVariant () {
79
84
// bootloader configures LED_BUILTIN as PWM output, deconfigure it to avoid spurious signals
80
85
pinMode (LED_BUILTIN, OUTPUT);
Original file line number Diff line number Diff line change @@ -80,6 +80,11 @@ static const ioport_cfg_t bsp_pin_cfg = {
80
80
};
81
81
static ioport_instance_ctrl_t ioport_ctrl;
82
82
83
+ void usb_post_initialization () {
84
+ ((R_USB_FS0_Type*)R_USB_FS0_BASE)->USBMC_b .VDCEN = 1 ;
85
+ ((R_USB_FS0_Type*)R_USB_FS0_BASE)->SYSCFG_b .DPRPU = 1 ;
86
+ }
87
+
83
88
void initVariant () {
84
89
// R_IOPORT_Open(&ioport_ctrl, &bsp_pin_cfg);
85
90
// R_IOPORT_PinCfg(NULL, BSP_IO_PORT_09_PIN_14, (uint32_t) (IOPORT_CFG_PERIPHERAL_PIN | IOPORT_PERIPHERAL_USB_FS));
Original file line number Diff line number Diff line change @@ -104,6 +104,10 @@ void configure_usb_mux() {
104
104
105
105
__attribute__ ((weak)) void __maybe_start_usb() {}
106
106
107
+ void usb_post_initialization () {
108
+ ((R_USB_FS0_Type*)R_USB_FS0_BASE)->USBMC_b .VDCEN = 1 ;
109
+ }
110
+
107
111
void initVariant () {
108
112
__maybe_start_usb ();
109
113
// bootloader configures LED_BUILTIN as PWM output, deconfigure it to avoid spurious signals
You can’t perform that action at this time.
0 commit comments