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/stm32h7/src/bin/usb_serial.rs | |
| parent | a2d1e7f02ca8d94c755ced56f1db11646ac2aa72 (diff) | |
stm32/otg: add VBUS detection.
Fixes #1442.
Diffstat (limited to 'examples/stm32h7/src/bin/usb_serial.rs')
| -rw-r--r-- | examples/stm32h7/src/bin/usb_serial.rs | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/examples/stm32h7/src/bin/usb_serial.rs b/examples/stm32h7/src/bin/usb_serial.rs index c622f19f7..97291f60c 100644 --- a/examples/stm32h7/src/bin/usb_serial.rs +++ b/examples/stm32h7/src/bin/usb_serial.rs | |||
| @@ -29,7 +29,9 @@ async fn main(_spawner: Spawner) { | |||
| 29 | 29 | ||
| 30 | // Create the driver, from the HAL. | 30 | // Create the driver, from the HAL. |
| 31 | let mut ep_out_buffer = [0u8; 256]; | 31 | let mut ep_out_buffer = [0u8; 256]; |
| 32 | let driver = Driver::new_fs(p.USB_OTG_FS, Irqs, p.PA12, p.PA11, &mut ep_out_buffer); | 32 | let mut config = embassy_stm32::usb_otg::Config::default(); |
| 33 | config.vbus_detection = true; | ||
| 34 | let driver = Driver::new_fs(p.USB_OTG_FS, Irqs, p.PA12, p.PA11, &mut ep_out_buffer, config); | ||
| 33 | 35 | ||
| 34 | // Create embassy-usb Config | 36 | // Create embassy-usb Config |
| 35 | let mut config = embassy_usb::Config::new(0xc0de, 0xcafe); | 37 | let mut config = embassy_usb::Config::new(0xc0de, 0xcafe); |
