diff options
| author | Dario Nieuwenhuis <[email protected]> | 2023-06-27 08:42:51 +0200 |
|---|---|---|
| committer | Dario Nieuwenhuis <[email protected]> | 2023-06-27 12:52:37 +0200 |
| commit | 219ef5b37a1dff5f6e770da252ec010d55c43257 (patch) | |
| tree | d90597e01633865ea810a55266c90a5d56d555ea /examples/stm32f7/src/bin | |
| parent | a2d1e7f02ca8d94c755ced56f1db11646ac2aa72 (diff) | |
stm32/otg: add VBUS detection.
Fixes #1442.
Diffstat (limited to 'examples/stm32f7/src/bin')
| -rw-r--r-- | examples/stm32f7/src/bin/usb_serial.rs | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/examples/stm32f7/src/bin/usb_serial.rs b/examples/stm32f7/src/bin/usb_serial.rs index 763309ce2..a2c76178b 100644 --- a/examples/stm32f7/src/bin/usb_serial.rs +++ b/examples/stm32f7/src/bin/usb_serial.rs | |||
| @@ -30,7 +30,9 @@ async fn main(_spawner: Spawner) { | |||
| 30 | 30 | ||
| 31 | // Create the driver, from the HAL. | 31 | // Create the driver, from the HAL. |
| 32 | let mut ep_out_buffer = [0u8; 256]; | 32 | let mut ep_out_buffer = [0u8; 256]; |
| 33 | let driver = Driver::new_fs(p.USB_OTG_FS, Irqs, p.PA12, p.PA11, &mut ep_out_buffer); | 33 | let mut config = embassy_stm32::usb_otg::Config::default(); |
| 34 | config.vbus_detection = true; | ||
| 35 | let driver = Driver::new_fs(p.USB_OTG_FS, Irqs, p.PA12, p.PA11, &mut ep_out_buffer, config); | ||
| 34 | 36 | ||
| 35 | // Create embassy-usb Config | 37 | // Create embassy-usb Config |
| 36 | let mut config = embassy_usb::Config::new(0xc0de, 0xcafe); | 38 | let mut config = embassy_usb::Config::new(0xc0de, 0xcafe); |
