Skip to content

Commit 8e43392

Browse files
committed
Set VBUSBSEN to 1
1 parent 0ebd518 commit 8e43392

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/bus.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -460,7 +460,8 @@ impl<USB: UsbPeripheral> usb_device::bus::UsbBus for UsbBus<USB> {
460460
//modify_reg!(otg_global, regs.global, GCCFG, NOVBUSSENS: 1);
461461
modify_reg!(otg_global, regs.global(), GCCFG, |r| r | (1 << 21));
462462

463-
modify_reg!(otg_global, regs.global(), GCCFG, VBUSASEN: 0, VBUSBSEN: 0, SOFOUTEN: 0);
463+
// VBUSBSEN=1 is required for GD32VF103
464+
modify_reg!(otg_global, regs.global(), GCCFG, VBUSASEN: 0, VBUSBSEN: 1, SOFOUTEN: 0);
464465
}
465466
0x0000_2000 | 0x0000_2100 | 0x0000_2300 | 0x0000_3000 | 0x0000_3100 => {
466467
// F446-like chips have the GCCFG.VBDEN bit with the opposite meaning

0 commit comments

Comments
 (0)