Skip to content

Commit ed59f51

Browse files
Fix remap_pins in example`
1 parent a7daf77 commit ed59f51

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

examples/usb_serial.rs

+9-9
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,15 @@ use usbd_serial::{SerialPort, USB_CLASS_CDC};
1515
fn main() -> ! {
1616
let mut dp = pac::Peripherals::take().unwrap();
1717

18+
/*
19+
* IMPORTANT: if you have a chip in TSSOP20 (STM32F042F) or UFQFPN28 (STM32F042G) package,
20+
* and want to use USB, make sure you call `remap_pins(rcc, syscfg)`, otherwise the device will not enumerate.
21+
*
22+
* Uncomment the following function if the situation above applies to you.
23+
*/
24+
25+
// stm32f0xx_hal::usb::remap_pins(&mut dp.RCC, &mut dp.SYSCFG);
26+
1827
let mut rcc = dp
1928
.RCC
2029
.configure()
@@ -41,15 +50,6 @@ fn main() -> ! {
4150

4251
let mut serial = SerialPort::new(&usb_bus);
4352

44-
/*
45-
* IMPORTANT: if you have a chip in TSSOP20 (STM32F042F) or UFQFPN28 (STM32F042G) package,
46-
* and want to use USB, make sure you call `remap_pins(rcc, syscfg)`, otherwise the device will not enumerate.
47-
*
48-
* Uncomment the following function if the situation above applies to you.
49-
*/
50-
51-
//usb_bus.remap_pins();
52-
5353
let mut usb_dev = UsbDeviceBuilder::new(&usb_bus, UsbVidPid(0x16c0, 0x27dd))
5454
.manufacturer("Fake company")
5555
.product("Serial port")

0 commit comments

Comments
 (0)