diff options
| author | xoviat <[email protected]> | 2023-05-24 17:29:56 -0500 |
|---|---|---|
| committer | xoviat <[email protected]> | 2023-05-24 17:29:56 -0500 |
| commit | 316be179af500fdf31606f085adf77c6879a396d (patch) | |
| tree | 7a100f1dc652a53a327d0c0bd7a53be216db30c0 /examples/stm32f1 | |
| parent | 627d7f66efb7ff3dcf627477814c52ba4171bade (diff) | |
stm32: move to bind_interrupts
disable lora functionality for now
Diffstat (limited to 'examples/stm32f1')
| -rw-r--r-- | examples/stm32f1/src/bin/usb_serial.rs | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/examples/stm32f1/src/bin/usb_serial.rs b/examples/stm32f1/src/bin/usb_serial.rs index 07cad84ef..663099ff7 100644 --- a/examples/stm32f1/src/bin/usb_serial.rs +++ b/examples/stm32f1/src/bin/usb_serial.rs | |||
| @@ -8,13 +8,17 @@ use embassy_futures::join::join; | |||
| 8 | use embassy_stm32::gpio::{Level, Output, Speed}; | 8 | use embassy_stm32::gpio::{Level, Output, Speed}; |
| 9 | use embassy_stm32::time::Hertz; | 9 | use embassy_stm32::time::Hertz; |
| 10 | use embassy_stm32::usb::{Driver, Instance}; | 10 | use embassy_stm32::usb::{Driver, Instance}; |
| 11 | use embassy_stm32::{interrupt, Config}; | 11 | use embassy_stm32::{bind_interrupts, peripherals, usb, Config}; |
| 12 | use embassy_time::{Duration, Timer}; | 12 | use embassy_time::{Duration, Timer}; |
| 13 | use embassy_usb::class::cdc_acm::{CdcAcmClass, State}; | 13 | use embassy_usb::class::cdc_acm::{CdcAcmClass, State}; |
| 14 | use embassy_usb::driver::EndpointError; | 14 | use embassy_usb::driver::EndpointError; |
| 15 | use embassy_usb::Builder; | 15 | use embassy_usb::Builder; |
| 16 | use {defmt_rtt as _, panic_probe as _}; | 16 | use {defmt_rtt as _, panic_probe as _}; |
| 17 | 17 | ||
| 18 | bind_interrupts!(struct Irqs { | ||
| 19 | USB_LP_CAN1_RX0 => usb::InterruptHandler<peripherals::USB>; | ||
| 20 | }); | ||
| 21 | |||
| 18 | #[embassy_executor::main] | 22 | #[embassy_executor::main] |
| 19 | async fn main(_spawner: Spawner) { | 23 | async fn main(_spawner: Spawner) { |
| 20 | let mut config = Config::default(); | 24 | let mut config = Config::default(); |
| @@ -35,8 +39,7 @@ async fn main(_spawner: Spawner) { | |||
| 35 | } | 39 | } |
| 36 | 40 | ||
| 37 | // Create the driver, from the HAL. | 41 | // Create the driver, from the HAL. |
| 38 | let irq = interrupt::take!(USB_LP_CAN1_RX0); | 42 | let driver = Driver::new(p.USB, Irqs, p.PA12, p.PA11); |
| 39 | let driver = Driver::new(p.USB, irq, p.PA12, p.PA11); | ||
| 40 | 43 | ||
| 41 | // Create embassy-usb Config | 44 | // Create embassy-usb Config |
| 42 | let config = embassy_usb::Config::new(0xc0de, 0xcafe); | 45 | let config = embassy_usb::Config::new(0xc0de, 0xcafe); |
