diff options
Diffstat (limited to 'examples')
27 files changed, 43 insertions, 60 deletions
diff --git a/examples/boot/application/nrf/src/bin/a.rs b/examples/boot/application/nrf/src/bin/a.rs index 133a3e678..7a404a914 100644 --- a/examples/boot/application/nrf/src/bin/a.rs +++ b/examples/boot/application/nrf/src/bin/a.rs | |||
| @@ -1,7 +1,6 @@ | |||
| 1 | #![no_std] | 1 | #![no_std] |
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | #![macro_use] | 3 | #![macro_use] |
| 4 | #![feature(generic_associated_types)] | ||
| 5 | #![feature(type_alias_impl_trait)] | 4 | #![feature(type_alias_impl_trait)] |
| 6 | 5 | ||
| 7 | use embassy_boot_nrf::FirmwareUpdater; | 6 | use embassy_boot_nrf::FirmwareUpdater; |
diff --git a/examples/boot/application/nrf/src/bin/b.rs b/examples/boot/application/nrf/src/bin/b.rs index 5394bf0c7..1373f277d 100644 --- a/examples/boot/application/nrf/src/bin/b.rs +++ b/examples/boot/application/nrf/src/bin/b.rs | |||
| @@ -1,7 +1,6 @@ | |||
| 1 | #![no_std] | 1 | #![no_std] |
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | #![macro_use] | 3 | #![macro_use] |
| 4 | #![feature(generic_associated_types)] | ||
| 5 | #![feature(type_alias_impl_trait)] | 4 | #![feature(type_alias_impl_trait)] |
| 6 | 5 | ||
| 7 | use embassy_executor::Spawner; | 6 | use embassy_executor::Spawner; |
diff --git a/examples/boot/bootloader/nrf/src/main.rs b/examples/boot/bootloader/nrf/src/main.rs index 9031997c2..8266206b3 100644 --- a/examples/boot/bootloader/nrf/src/main.rs +++ b/examples/boot/bootloader/nrf/src/main.rs | |||
| @@ -21,7 +21,7 @@ fn main() -> ! { | |||
| 21 | 21 | ||
| 22 | let mut bl = BootLoader::default(); | 22 | let mut bl = BootLoader::default(); |
| 23 | let start = bl.prepare(&mut SingleFlashConfig::new(&mut BootFlash::<_, 4096>::new( | 23 | let start = bl.prepare(&mut SingleFlashConfig::new(&mut BootFlash::<_, 4096>::new( |
| 24 | &mut WatchdogFlash::start(Nvmc::new(p.NVMC), p.WDT, 5), | 24 | WatchdogFlash::start(Nvmc::new(p.NVMC), p.WDT, 5), |
| 25 | ))); | 25 | ))); |
| 26 | unsafe { bl.load(start) } | 26 | unsafe { bl.load(start) } |
| 27 | } | 27 | } |
diff --git a/examples/boot/bootloader/stm32/src/main.rs b/examples/boot/bootloader/stm32/src/main.rs index bb5d3e531..294464d1c 100644 --- a/examples/boot/bootloader/stm32/src/main.rs +++ b/examples/boot/bootloader/stm32/src/main.rs | |||
| @@ -20,10 +20,9 @@ fn main() -> ! { | |||
| 20 | */ | 20 | */ |
| 21 | 21 | ||
| 22 | let mut bl: BootLoader<ERASE_SIZE, WRITE_SIZE> = BootLoader::default(); | 22 | let mut bl: BootLoader<ERASE_SIZE, WRITE_SIZE> = BootLoader::default(); |
| 23 | let mut flash = Flash::unlock(p.FLASH); | 23 | let flash = Flash::unlock(p.FLASH); |
| 24 | let start = bl.prepare(&mut SingleFlashConfig::new( | 24 | let mut flash = BootFlash::<_, ERASE_SIZE, ERASE_VALUE>::new(flash); |
| 25 | &mut BootFlash::<_, ERASE_SIZE, ERASE_VALUE>::new(&mut flash), | 25 | let start = bl.prepare(&mut SingleFlashConfig::new(&mut flash)); |
| 26 | )); | ||
| 27 | core::mem::drop(flash); | 26 | core::mem::drop(flash); |
| 28 | unsafe { bl.load(start) } | 27 | unsafe { bl.load(start) } |
| 29 | } | 28 | } |
diff --git a/examples/nrf-rtos-trace/src/bin/rtos_trace.rs b/examples/nrf-rtos-trace/src/bin/rtos_trace.rs index 7d1ad87c8..cf8b2f808 100644 --- a/examples/nrf-rtos-trace/src/bin/rtos_trace.rs +++ b/examples/nrf-rtos-trace/src/bin/rtos_trace.rs | |||
| @@ -2,6 +2,7 @@ | |||
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | #![feature(type_alias_impl_trait)] | 3 | #![feature(type_alias_impl_trait)] |
| 4 | 4 | ||
| 5 | use core::future::poll_fn; | ||
| 5 | use core::task::Poll; | 6 | use core::task::Poll; |
| 6 | 7 | ||
| 7 | use embassy_executor::Spawner; | 8 | use embassy_executor::Spawner; |
| @@ -46,7 +47,7 @@ async fn run2() { | |||
| 46 | 47 | ||
| 47 | #[embassy_executor::task] | 48 | #[embassy_executor::task] |
| 48 | async fn run3() { | 49 | async fn run3() { |
| 49 | futures::future::poll_fn(|cx| { | 50 | poll_fn(|cx| { |
| 50 | cx.waker().wake_by_ref(); | 51 | cx.waker().wake_by_ref(); |
| 51 | Poll::<()>::Pending | 52 | Poll::<()>::Pending |
| 52 | }) | 53 | }) |
diff --git a/examples/nrf/Cargo.toml b/examples/nrf/Cargo.toml index dbc659cda..a5d340c69 100644 --- a/examples/nrf/Cargo.toml +++ b/examples/nrf/Cargo.toml | |||
| @@ -5,7 +5,7 @@ version = "0.1.0" | |||
| 5 | 5 | ||
| 6 | [features] | 6 | [features] |
| 7 | default = ["nightly"] | 7 | default = ["nightly"] |
| 8 | nightly = ["embassy-executor/nightly", "embassy-nrf/nightly", "embassy-net/nightly", "embassy-nrf/unstable-traits", "embassy-usb", "embassy-usb-serial", "embassy-usb-hid", "embassy-usb-ncm", "embedded-io/async", "embassy-net"] | 8 | nightly = ["embassy-executor/nightly", "embassy-nrf/nightly", "embassy-net/nightly", "embassy-nrf/unstable-traits", "embassy-usb", "embedded-io/async", "embassy-net"] |
| 9 | 9 | ||
| 10 | [dependencies] | 10 | [dependencies] |
| 11 | embassy-futures = { version = "0.1.0", path = "../../embassy-futures" } | 11 | embassy-futures = { version = "0.1.0", path = "../../embassy-futures" } |
| @@ -15,9 +15,6 @@ embassy-time = { version = "0.1.0", path = "../../embassy-time", features = ["de | |||
| 15 | embassy-nrf = { version = "0.1.0", path = "../../embassy-nrf", features = ["defmt", "nrf52840", "time-driver-rtc1", "gpiote", "unstable-pac"] } | 15 | embassy-nrf = { version = "0.1.0", path = "../../embassy-nrf", features = ["defmt", "nrf52840", "time-driver-rtc1", "gpiote", "unstable-pac"] } |
| 16 | embassy-net = { version = "0.1.0", path = "../../embassy-net", features = ["defmt", "tcp", "dhcpv4", "medium-ethernet", "pool-16"], optional = true } | 16 | embassy-net = { version = "0.1.0", path = "../../embassy-net", features = ["defmt", "tcp", "dhcpv4", "medium-ethernet", "pool-16"], optional = true } |
| 17 | embassy-usb = { version = "0.1.0", path = "../../embassy-usb", features = ["defmt"], optional = true } | 17 | embassy-usb = { version = "0.1.0", path = "../../embassy-usb", features = ["defmt"], optional = true } |
| 18 | embassy-usb-serial = { version = "0.1.0", path = "../../embassy-usb-serial", features = ["defmt"], optional = true } | ||
| 19 | embassy-usb-hid = { version = "0.1.0", path = "../../embassy-usb-hid", features = ["defmt"], optional = true } | ||
| 20 | embassy-usb-ncm = { version = "0.1.0", path = "../../embassy-usb-ncm", features = ["defmt"], optional = true } | ||
| 21 | embedded-io = "0.3.0" | 18 | embedded-io = "0.3.0" |
| 22 | 19 | ||
| 23 | defmt = "0.3" | 20 | defmt = "0.3" |
diff --git a/examples/nrf/src/bin/executor_fairness_test.rs b/examples/nrf/src/bin/executor_fairness_test.rs index 9ae030d07..2a28f2763 100644 --- a/examples/nrf/src/bin/executor_fairness_test.rs +++ b/examples/nrf/src/bin/executor_fairness_test.rs | |||
| @@ -2,6 +2,7 @@ | |||
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | #![feature(type_alias_impl_trait)] | 3 | #![feature(type_alias_impl_trait)] |
| 4 | 4 | ||
| 5 | use core::future::poll_fn; | ||
| 5 | use core::task::Poll; | 6 | use core::task::Poll; |
| 6 | 7 | ||
| 7 | use defmt::{info, unwrap}; | 8 | use defmt::{info, unwrap}; |
| @@ -26,7 +27,7 @@ async fn run2() { | |||
| 26 | 27 | ||
| 27 | #[embassy_executor::task] | 28 | #[embassy_executor::task] |
| 28 | async fn run3() { | 29 | async fn run3() { |
| 29 | futures::future::poll_fn(|cx| { | 30 | poll_fn(|cx| { |
| 30 | cx.waker().wake_by_ref(); | 31 | cx.waker().wake_by_ref(); |
| 31 | Poll::<()>::Pending | 32 | Poll::<()>::Pending |
| 32 | }) | 33 | }) |
diff --git a/examples/nrf/src/bin/usb_ethernet.rs b/examples/nrf/src/bin/usb_ethernet.rs index 352660b59..de93a2b45 100644 --- a/examples/nrf/src/bin/usb_ethernet.rs +++ b/examples/nrf/src/bin/usb_ethernet.rs | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | #![no_std] | 1 | #![no_std] |
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | #![feature(generic_associated_types)] | ||
| 4 | #![feature(type_alias_impl_trait)] | 3 | #![feature(type_alias_impl_trait)] |
| 5 | 4 | ||
| 6 | use core::mem; | 5 | use core::mem; |
| @@ -16,8 +15,8 @@ use embassy_nrf::usb::{Driver, PowerUsb}; | |||
| 16 | use embassy_nrf::{interrupt, pac, peripherals}; | 15 | use embassy_nrf::{interrupt, pac, peripherals}; |
| 17 | use embassy_sync::blocking_mutex::raw::ThreadModeRawMutex; | 16 | use embassy_sync::blocking_mutex::raw::ThreadModeRawMutex; |
| 18 | use embassy_sync::channel::Channel; | 17 | use embassy_sync::channel::Channel; |
| 18 | use embassy_usb::class::cdc_ncm::{CdcNcmClass, Receiver, Sender, State}; | ||
| 19 | use embassy_usb::{Builder, Config, UsbDevice}; | 19 | use embassy_usb::{Builder, Config, UsbDevice}; |
| 20 | use embassy_usb_ncm::{CdcNcmClass, Receiver, Sender, State}; | ||
| 21 | use embedded_io::asynch::Write; | 20 | use embedded_io::asynch::Write; |
| 22 | use static_cell::StaticCell; | 21 | use static_cell::StaticCell; |
| 23 | use {defmt_rtt as _, panic_probe as _}; | 22 | use {defmt_rtt as _, panic_probe as _}; |
diff --git a/examples/nrf/src/bin/usb_hid_keyboard.rs b/examples/nrf/src/bin/usb_hid_keyboard.rs index 7fdb0b685..76e198719 100644 --- a/examples/nrf/src/bin/usb_hid_keyboard.rs +++ b/examples/nrf/src/bin/usb_hid_keyboard.rs | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | #![no_std] | 1 | #![no_std] |
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | #![feature(generic_associated_types)] | ||
| 4 | #![feature(type_alias_impl_trait)] | 3 | #![feature(type_alias_impl_trait)] |
| 5 | 4 | ||
| 6 | use core::mem; | 5 | use core::mem; |
| @@ -8,15 +7,16 @@ use core::sync::atomic::{AtomicBool, Ordering}; | |||
| 8 | 7 | ||
| 9 | use defmt::*; | 8 | use defmt::*; |
| 10 | use embassy_executor::Spawner; | 9 | use embassy_executor::Spawner; |
| 10 | use embassy_futures::join::join; | ||
| 11 | use embassy_futures::select::{select, Either}; | 11 | use embassy_futures::select::{select, Either}; |
| 12 | use embassy_nrf::gpio::{Input, Pin, Pull}; | 12 | use embassy_nrf::gpio::{Input, Pin, Pull}; |
| 13 | use embassy_nrf::usb::{Driver, PowerUsb}; | 13 | use embassy_nrf::usb::{Driver, PowerUsb}; |
| 14 | use embassy_nrf::{interrupt, pac}; | 14 | use embassy_nrf::{interrupt, pac}; |
| 15 | use embassy_sync::blocking_mutex::raw::CriticalSectionRawMutex; | ||
| 15 | use embassy_sync::signal::Signal; | 16 | use embassy_sync::signal::Signal; |
| 17 | use embassy_usb::class::hid::{HidReaderWriter, ReportId, RequestHandler, State}; | ||
| 16 | use embassy_usb::control::OutResponse; | 18 | use embassy_usb::control::OutResponse; |
| 17 | use embassy_usb::{Builder, Config, DeviceStateHandler}; | 19 | use embassy_usb::{Builder, Config, DeviceStateHandler}; |
| 18 | use embassy_usb_hid::{HidReaderWriter, ReportId, RequestHandler, State}; | ||
| 19 | use futures::future::join; | ||
| 20 | use usbd_hid::descriptor::{KeyboardReport, SerializedDescriptor}; | 20 | use usbd_hid::descriptor::{KeyboardReport, SerializedDescriptor}; |
| 21 | use {defmt_rtt as _, panic_probe as _}; | 21 | use {defmt_rtt as _, panic_probe as _}; |
| 22 | 22 | ||
| @@ -67,7 +67,7 @@ async fn main(_spawner: Spawner) { | |||
| 67 | ); | 67 | ); |
| 68 | 68 | ||
| 69 | // Create classes on the builder. | 69 | // Create classes on the builder. |
| 70 | let config = embassy_usb_hid::Config { | 70 | let config = embassy_usb::class::hid::Config { |
| 71 | report_descriptor: KeyboardReport::desc(), | 71 | report_descriptor: KeyboardReport::desc(), |
| 72 | request_handler: Some(&request_handler), | 72 | request_handler: Some(&request_handler), |
| 73 | poll_ms: 60, | 73 | poll_ms: 60, |
| @@ -78,7 +78,7 @@ async fn main(_spawner: Spawner) { | |||
| 78 | // Build the builder. | 78 | // Build the builder. |
| 79 | let mut usb = builder.build(); | 79 | let mut usb = builder.build(); |
| 80 | 80 | ||
| 81 | let remote_wakeup = Signal::new(); | 81 | let remote_wakeup: Signal<CriticalSectionRawMutex, _> = Signal::new(); |
| 82 | 82 | ||
| 83 | // Run the USB device. | 83 | // Run the USB device. |
| 84 | let usb_fut = async { | 84 | let usb_fut = async { |
diff --git a/examples/nrf/src/bin/usb_hid_mouse.rs b/examples/nrf/src/bin/usb_hid_mouse.rs index 7cd2ece17..4916a38d4 100644 --- a/examples/nrf/src/bin/usb_hid_mouse.rs +++ b/examples/nrf/src/bin/usb_hid_mouse.rs | |||
| @@ -1,19 +1,18 @@ | |||
| 1 | #![no_std] | 1 | #![no_std] |
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | #![feature(generic_associated_types)] | ||
| 4 | #![feature(type_alias_impl_trait)] | 3 | #![feature(type_alias_impl_trait)] |
| 5 | 4 | ||
| 6 | use core::mem; | 5 | use core::mem; |
| 7 | 6 | ||
| 8 | use defmt::*; | 7 | use defmt::*; |
| 9 | use embassy_executor::Spawner; | 8 | use embassy_executor::Spawner; |
| 9 | use embassy_futures::join::join; | ||
| 10 | use embassy_nrf::usb::{Driver, PowerUsb}; | 10 | use embassy_nrf::usb::{Driver, PowerUsb}; |
| 11 | use embassy_nrf::{interrupt, pac}; | 11 | use embassy_nrf::{interrupt, pac}; |
| 12 | use embassy_time::{Duration, Timer}; | 12 | use embassy_time::{Duration, Timer}; |
| 13 | use embassy_usb::class::hid::{HidWriter, ReportId, RequestHandler, State}; | ||
| 13 | use embassy_usb::control::OutResponse; | 14 | use embassy_usb::control::OutResponse; |
| 14 | use embassy_usb::{Builder, Config}; | 15 | use embassy_usb::{Builder, Config}; |
| 15 | use embassy_usb_hid::{HidWriter, ReportId, RequestHandler, State}; | ||
| 16 | use futures::future::join; | ||
| 17 | use usbd_hid::descriptor::{MouseReport, SerializedDescriptor}; | 16 | use usbd_hid::descriptor::{MouseReport, SerializedDescriptor}; |
| 18 | use {defmt_rtt as _, panic_probe as _}; | 17 | use {defmt_rtt as _, panic_probe as _}; |
| 19 | 18 | ||
| @@ -60,7 +59,7 @@ async fn main(_spawner: Spawner) { | |||
| 60 | ); | 59 | ); |
| 61 | 60 | ||
| 62 | // Create classes on the builder. | 61 | // Create classes on the builder. |
| 63 | let config = embassy_usb_hid::Config { | 62 | let config = embassy_usb::class::hid::Config { |
| 64 | report_descriptor: MouseReport::desc(), | 63 | report_descriptor: MouseReport::desc(), |
| 65 | request_handler: Some(&request_handler), | 64 | request_handler: Some(&request_handler), |
| 66 | poll_ms: 60, | 65 | poll_ms: 60, |
diff --git a/examples/nrf/src/bin/usb_serial.rs b/examples/nrf/src/bin/usb_serial.rs index a68edb329..7c9c4184b 100644 --- a/examples/nrf/src/bin/usb_serial.rs +++ b/examples/nrf/src/bin/usb_serial.rs | |||
| @@ -1,18 +1,17 @@ | |||
| 1 | #![no_std] | 1 | #![no_std] |
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | #![feature(generic_associated_types)] | ||
| 4 | #![feature(type_alias_impl_trait)] | 3 | #![feature(type_alias_impl_trait)] |
| 5 | 4 | ||
| 6 | use core::mem; | 5 | use core::mem; |
| 7 | 6 | ||
| 8 | use defmt::{info, panic}; | 7 | use defmt::{info, panic}; |
| 9 | use embassy_executor::Spawner; | 8 | use embassy_executor::Spawner; |
| 9 | use embassy_futures::join::join; | ||
| 10 | use embassy_nrf::usb::{Driver, Instance, PowerUsb, UsbSupply}; | 10 | use embassy_nrf::usb::{Driver, Instance, PowerUsb, UsbSupply}; |
| 11 | use embassy_nrf::{interrupt, pac}; | 11 | use embassy_nrf::{interrupt, pac}; |
| 12 | use embassy_usb::class::cdc_acm::{CdcAcmClass, State}; | ||
| 12 | use embassy_usb::driver::EndpointError; | 13 | use embassy_usb::driver::EndpointError; |
| 13 | use embassy_usb::{Builder, Config}; | 14 | use embassy_usb::{Builder, Config}; |
| 14 | use embassy_usb_serial::{CdcAcmClass, State}; | ||
| 15 | use futures::future::join; | ||
| 16 | use {defmt_rtt as _, panic_probe as _}; | 15 | use {defmt_rtt as _, panic_probe as _}; |
| 17 | 16 | ||
| 18 | #[embassy_executor::main] | 17 | #[embassy_executor::main] |
diff --git a/examples/nrf/src/bin/usb_serial_multitask.rs b/examples/nrf/src/bin/usb_serial_multitask.rs index d62d7e520..93efc2fe6 100644 --- a/examples/nrf/src/bin/usb_serial_multitask.rs +++ b/examples/nrf/src/bin/usb_serial_multitask.rs | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | #![no_std] | 1 | #![no_std] |
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | #![feature(generic_associated_types)] | ||
| 4 | #![feature(type_alias_impl_trait)] | 3 | #![feature(type_alias_impl_trait)] |
| 5 | 4 | ||
| 6 | use core::mem; | 5 | use core::mem; |
| @@ -9,9 +8,9 @@ use defmt::{info, panic, unwrap}; | |||
| 9 | use embassy_executor::Spawner; | 8 | use embassy_executor::Spawner; |
| 10 | use embassy_nrf::usb::{Driver, PowerUsb}; | 9 | use embassy_nrf::usb::{Driver, PowerUsb}; |
| 11 | use embassy_nrf::{interrupt, pac, peripherals}; | 10 | use embassy_nrf::{interrupt, pac, peripherals}; |
| 11 | use embassy_usb::class::cdc_acm::{CdcAcmClass, State}; | ||
| 12 | use embassy_usb::driver::EndpointError; | 12 | use embassy_usb::driver::EndpointError; |
| 13 | use embassy_usb::{Builder, Config, UsbDevice}; | 13 | use embassy_usb::{Builder, Config, UsbDevice}; |
| 14 | use embassy_usb_serial::{CdcAcmClass, State}; | ||
| 15 | use static_cell::StaticCell; | 14 | use static_cell::StaticCell; |
| 16 | use {defmt_rtt as _, panic_probe as _}; | 15 | use {defmt_rtt as _, panic_probe as _}; |
| 17 | 16 | ||
diff --git a/examples/rp/Cargo.toml b/examples/rp/Cargo.toml index 18a92b094..3c8f923e7 100644 --- a/examples/rp/Cargo.toml +++ b/examples/rp/Cargo.toml | |||
| @@ -8,11 +8,10 @@ version = "0.1.0" | |||
| 8 | embassy-sync = { version = "0.1.0", path = "../../embassy-sync", features = ["defmt"] } | 8 | embassy-sync = { version = "0.1.0", path = "../../embassy-sync", features = ["defmt"] } |
| 9 | embassy-executor = { version = "0.1.0", path = "../../embassy-executor", features = ["defmt", "integrated-timers"] } | 9 | embassy-executor = { version = "0.1.0", path = "../../embassy-executor", features = ["defmt", "integrated-timers"] } |
| 10 | embassy-time = { version = "0.1.0", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime"] } | 10 | embassy-time = { version = "0.1.0", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime"] } |
| 11 | embassy-rp = { version = "0.1.0", path = "../../embassy-rp", features = ["defmt", "unstable-traits", "nightly", "unstable-pac"] } | 11 | embassy-rp = { version = "0.1.0", path = "../../embassy-rp", features = ["defmt", "unstable-traits", "nightly", "unstable-pac", "time-driver"] } |
| 12 | embassy-usb = { version = "0.1.0", path = "../../embassy-usb", features = ["defmt"] } | 12 | embassy-usb = { version = "0.1.0", path = "../../embassy-usb", features = ["defmt"] } |
| 13 | embassy-usb-serial = { version = "0.1.0", path = "../../embassy-usb-serial", features = ["defmt"] } | ||
| 14 | embassy-net = { version = "0.1.0", path = "../../embassy-net", features = ["defmt", "nightly", "tcp", "dhcpv4", "medium-ethernet", "pool-16"] } | 13 | embassy-net = { version = "0.1.0", path = "../../embassy-net", features = ["defmt", "nightly", "tcp", "dhcpv4", "medium-ethernet", "pool-16"] } |
| 15 | embassy-usb-ncm = { version = "0.1.0", path = "../../embassy-usb-ncm", features = ["defmt"] } | 14 | embassy-futures = { version = "0.1.0", path = "../../embassy-futures" } |
| 16 | 15 | ||
| 17 | defmt = "0.3" | 16 | defmt = "0.3" |
| 18 | defmt-rtt = "0.3" | 17 | defmt-rtt = "0.3" |
diff --git a/examples/rp/src/bin/usb_ethernet.rs b/examples/rp/src/bin/usb_ethernet.rs index 2df7f62f6..1057fe7fd 100644 --- a/examples/rp/src/bin/usb_ethernet.rs +++ b/examples/rp/src/bin/usb_ethernet.rs | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | #![no_std] | 1 | #![no_std] |
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | #![feature(generic_associated_types)] | ||
| 4 | #![feature(type_alias_impl_trait)] | 3 | #![feature(type_alias_impl_trait)] |
| 5 | 4 | ||
| 6 | use core::sync::atomic::{AtomicBool, Ordering}; | 5 | use core::sync::atomic::{AtomicBool, Ordering}; |
| @@ -14,8 +13,8 @@ use embassy_rp::usb::Driver; | |||
| 14 | use embassy_rp::{interrupt, peripherals}; | 13 | use embassy_rp::{interrupt, peripherals}; |
| 15 | use embassy_sync::blocking_mutex::raw::ThreadModeRawMutex; | 14 | use embassy_sync::blocking_mutex::raw::ThreadModeRawMutex; |
| 16 | use embassy_sync::channel::Channel; | 15 | use embassy_sync::channel::Channel; |
| 16 | use embassy_usb::class::cdc_ncm::{CdcNcmClass, Receiver, Sender, State}; | ||
| 17 | use embassy_usb::{Builder, Config, UsbDevice}; | 17 | use embassy_usb::{Builder, Config, UsbDevice}; |
| 18 | use embassy_usb_ncm::{CdcNcmClass, Receiver, Sender, State}; | ||
| 19 | use embedded_io::asynch::Write; | 18 | use embedded_io::asynch::Write; |
| 20 | use static_cell::StaticCell; | 19 | use static_cell::StaticCell; |
| 21 | use {defmt_rtt as _, panic_probe as _}; | 20 | use {defmt_rtt as _, panic_probe as _}; |
diff --git a/examples/rp/src/bin/usb_serial.rs b/examples/rp/src/bin/usb_serial.rs index 74be1f598..b7d6493b4 100644 --- a/examples/rp/src/bin/usb_serial.rs +++ b/examples/rp/src/bin/usb_serial.rs | |||
| @@ -1,16 +1,15 @@ | |||
| 1 | #![no_std] | 1 | #![no_std] |
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | #![feature(generic_associated_types)] | ||
| 4 | #![feature(type_alias_impl_trait)] | 3 | #![feature(type_alias_impl_trait)] |
| 5 | 4 | ||
| 6 | use defmt::{info, panic}; | 5 | use defmt::{info, panic}; |
| 7 | use embassy_executor::Spawner; | 6 | use embassy_executor::Spawner; |
| 7 | use embassy_futures::join::join; | ||
| 8 | use embassy_rp::interrupt; | 8 | use embassy_rp::interrupt; |
| 9 | use embassy_rp::usb::{Driver, Instance}; | 9 | use embassy_rp::usb::{Driver, Instance}; |
| 10 | use embassy_usb::class::cdc_acm::{CdcAcmClass, State}; | ||
| 10 | use embassy_usb::driver::EndpointError; | 11 | use embassy_usb::driver::EndpointError; |
| 11 | use embassy_usb::{Builder, Config}; | 12 | use embassy_usb::{Builder, Config}; |
| 12 | use embassy_usb_serial::{CdcAcmClass, State}; | ||
| 13 | use futures::future::join; | ||
| 14 | use {defmt_rtt as _, panic_probe as _}; | 13 | use {defmt_rtt as _, panic_probe as _}; |
| 15 | 14 | ||
| 16 | #[embassy_executor::main] | 15 | #[embassy_executor::main] |
diff --git a/examples/stm32f1/Cargo.toml b/examples/stm32f1/Cargo.toml index 33ac63db1..e6553789a 100644 --- a/examples/stm32f1/Cargo.toml +++ b/examples/stm32f1/Cargo.toml | |||
| @@ -9,7 +9,7 @@ embassy-executor = { version = "0.1.0", path = "../../embassy-executor", feature | |||
| 9 | embassy-time = { version = "0.1.0", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "tick-hz-32_768"] } | 9 | embassy-time = { version = "0.1.0", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "tick-hz-32_768"] } |
| 10 | embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["nightly", "defmt", "stm32f103c8", "unstable-pac", "memory-x", "time-driver-any"] } | 10 | embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["nightly", "defmt", "stm32f103c8", "unstable-pac", "memory-x", "time-driver-any"] } |
| 11 | embassy-usb = { version = "0.1.0", path = "../../embassy-usb", features = ["defmt"] } | 11 | embassy-usb = { version = "0.1.0", path = "../../embassy-usb", features = ["defmt"] } |
| 12 | embassy-usb-serial = { version = "0.1.0", path = "../../embassy-usb-serial", features = ["defmt"] } | 12 | embassy-futures = { version = "0.1.0", path = "../../embassy-futures" } |
| 13 | 13 | ||
| 14 | defmt = "0.3" | 14 | defmt = "0.3" |
| 15 | defmt-rtt = "0.3" | 15 | defmt-rtt = "0.3" |
diff --git a/examples/stm32f1/src/bin/usb_serial.rs b/examples/stm32f1/src/bin/usb_serial.rs index a9c46068f..ad92cdeb2 100644 --- a/examples/stm32f1/src/bin/usb_serial.rs +++ b/examples/stm32f1/src/bin/usb_serial.rs | |||
| @@ -4,15 +4,15 @@ | |||
| 4 | 4 | ||
| 5 | use defmt::{panic, *}; | 5 | use defmt::{panic, *}; |
| 6 | use embassy_executor::Spawner; | 6 | use embassy_executor::Spawner; |
| 7 | use embassy_futures::join::join; | ||
| 7 | use embassy_stm32::gpio::{Level, Output, Speed}; | 8 | use embassy_stm32::gpio::{Level, Output, Speed}; |
| 8 | use embassy_stm32::time::Hertz; | 9 | use embassy_stm32::time::Hertz; |
| 9 | use embassy_stm32::usb::{Driver, Instance}; | 10 | use embassy_stm32::usb::{Driver, Instance}; |
| 10 | use embassy_stm32::{interrupt, Config}; | 11 | use embassy_stm32::{interrupt, Config}; |
| 11 | use embassy_time::{Duration, Timer}; | 12 | use embassy_time::{Duration, Timer}; |
| 13 | use embassy_usb::class::cdc_acm::{CdcAcmClass, State}; | ||
| 12 | use embassy_usb::driver::EndpointError; | 14 | use embassy_usb::driver::EndpointError; |
| 13 | use embassy_usb::Builder; | 15 | use embassy_usb::Builder; |
| 14 | use embassy_usb_serial::{CdcAcmClass, State}; | ||
| 15 | use futures::future::join; | ||
| 16 | use {defmt_rtt as _, panic_probe as _}; | 16 | use {defmt_rtt as _, panic_probe as _}; |
| 17 | 17 | ||
| 18 | #[embassy_executor::main] | 18 | #[embassy_executor::main] |
diff --git a/examples/stm32f3/Cargo.toml b/examples/stm32f3/Cargo.toml index 208f39080..f5b0b880c 100644 --- a/examples/stm32f3/Cargo.toml +++ b/examples/stm32f3/Cargo.toml | |||
| @@ -9,8 +9,7 @@ embassy-executor = { version = "0.1.0", path = "../../embassy-executor", feature | |||
| 9 | embassy-time = { version = "0.1.0", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "tick-hz-32_768"] } | 9 | embassy-time = { version = "0.1.0", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "tick-hz-32_768"] } |
| 10 | embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["nightly", "defmt", "stm32f303ze", "unstable-pac", "memory-x", "time-driver-any", "exti"] } | 10 | embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["nightly", "defmt", "stm32f303ze", "unstable-pac", "memory-x", "time-driver-any", "exti"] } |
| 11 | embassy-usb = { version = "0.1.0", path = "../../embassy-usb", features = ["defmt"] } | 11 | embassy-usb = { version = "0.1.0", path = "../../embassy-usb", features = ["defmt"] } |
| 12 | embassy-usb-serial = { version = "0.1.0", path = "../../embassy-usb-serial", features = ["defmt"] } | 12 | embassy-futures = { version = "0.1.0", path = "../../embassy-futures" } |
| 13 | embassy-usb-hid = { version = "0.1.0", path = "../../embassy-usb-hid", features = ["defmt"] } | ||
| 14 | 13 | ||
| 15 | defmt = "0.3" | 14 | defmt = "0.3" |
| 16 | defmt-rtt = "0.3" | 15 | defmt-rtt = "0.3" |
diff --git a/examples/stm32f3/src/bin/usb_serial.rs b/examples/stm32f3/src/bin/usb_serial.rs index d3702fc35..f6d27c860 100644 --- a/examples/stm32f3/src/bin/usb_serial.rs +++ b/examples/stm32f3/src/bin/usb_serial.rs | |||
| @@ -4,15 +4,15 @@ | |||
| 4 | 4 | ||
| 5 | use defmt::{panic, *}; | 5 | use defmt::{panic, *}; |
| 6 | use embassy_executor::Spawner; | 6 | use embassy_executor::Spawner; |
| 7 | use embassy_futures::join::join; | ||
| 7 | use embassy_stm32::gpio::{Level, Output, Speed}; | 8 | use embassy_stm32::gpio::{Level, Output, Speed}; |
| 8 | use embassy_stm32::time::mhz; | 9 | use embassy_stm32::time::mhz; |
| 9 | use embassy_stm32::usb::{Driver, Instance}; | 10 | use embassy_stm32::usb::{Driver, Instance}; |
| 10 | use embassy_stm32::{interrupt, Config}; | 11 | use embassy_stm32::{interrupt, Config}; |
| 11 | use embassy_time::{Duration, Timer}; | 12 | use embassy_time::{Duration, Timer}; |
| 13 | use embassy_usb::class::cdc_acm::{CdcAcmClass, State}; | ||
| 12 | use embassy_usb::driver::EndpointError; | 14 | use embassy_usb::driver::EndpointError; |
| 13 | use embassy_usb::Builder; | 15 | use embassy_usb::Builder; |
| 14 | use embassy_usb_serial::{CdcAcmClass, State}; | ||
| 15 | use futures::future::join; | ||
| 16 | use {defmt_rtt as _, panic_probe as _}; | 16 | use {defmt_rtt as _, panic_probe as _}; |
| 17 | 17 | ||
| 18 | #[embassy_executor::main] | 18 | #[embassy_executor::main] |
diff --git a/examples/stm32h7/src/bin/signal.rs b/examples/stm32h7/src/bin/signal.rs index cc3e4e3ca..6d7c168d5 100644 --- a/examples/stm32h7/src/bin/signal.rs +++ b/examples/stm32h7/src/bin/signal.rs | |||
| @@ -4,11 +4,12 @@ | |||
| 4 | 4 | ||
| 5 | use defmt::{info, unwrap}; | 5 | use defmt::{info, unwrap}; |
| 6 | use embassy_executor::Spawner; | 6 | use embassy_executor::Spawner; |
| 7 | use embassy_sync::blocking_mutex::raw::CriticalSectionRawMutex; | ||
| 7 | use embassy_sync::signal::Signal; | 8 | use embassy_sync::signal::Signal; |
| 8 | use embassy_time::{Duration, Timer}; | 9 | use embassy_time::{Duration, Timer}; |
| 9 | use {defmt_rtt as _, panic_probe as _}; | 10 | use {defmt_rtt as _, panic_probe as _}; |
| 10 | 11 | ||
| 11 | static SIGNAL: Signal<u32> = Signal::new(); | 12 | static SIGNAL: Signal<CriticalSectionRawMutex, u32> = Signal::new(); |
| 12 | 13 | ||
| 13 | #[embassy_executor::task] | 14 | #[embassy_executor::task] |
| 14 | async fn my_sending_task() { | 15 | async fn my_sending_task() { |
diff --git a/examples/stm32l0/src/bin/lorawan.rs b/examples/stm32l0/src/bin/lorawan.rs index 00ff67f3f..27d7c29c2 100644 --- a/examples/stm32l0/src/bin/lorawan.rs +++ b/examples/stm32l0/src/bin/lorawan.rs | |||
| @@ -3,7 +3,6 @@ | |||
| 3 | #![no_main] | 3 | #![no_main] |
| 4 | #![macro_use] | 4 | #![macro_use] |
| 5 | #![allow(dead_code)] | 5 | #![allow(dead_code)] |
| 6 | #![feature(generic_associated_types)] | ||
| 7 | #![feature(type_alias_impl_trait)] | 6 | #![feature(type_alias_impl_trait)] |
| 8 | 7 | ||
| 9 | use embassy_executor::Spawner; | 8 | use embassy_executor::Spawner; |
diff --git a/examples/stm32l5/Cargo.toml b/examples/stm32l5/Cargo.toml index c451bd221..9ebab6476 100644 --- a/examples/stm32l5/Cargo.toml +++ b/examples/stm32l5/Cargo.toml | |||
| @@ -11,10 +11,8 @@ embassy-executor = { version = "0.1.0", path = "../../embassy-executor", feature | |||
| 11 | embassy-time = { version = "0.1.0", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "tick-hz-32_768"] } | 11 | embassy-time = { version = "0.1.0", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "tick-hz-32_768"] } |
| 12 | embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["nightly", "defmt", "unstable-pac", "stm32l552ze", "time-driver-any", "exti", "unstable-traits", "memory-x"] } | 12 | embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["nightly", "defmt", "unstable-pac", "stm32l552ze", "time-driver-any", "exti", "unstable-traits", "memory-x"] } |
| 13 | embassy-usb = { version = "0.1.0", path = "../../embassy-usb", features = ["defmt"] } | 13 | embassy-usb = { version = "0.1.0", path = "../../embassy-usb", features = ["defmt"] } |
| 14 | embassy-usb-serial = { version = "0.1.0", path = "../../embassy-usb-serial", features = ["defmt"] } | ||
| 15 | embassy-usb-hid = { version = "0.1.0", path = "../../embassy-usb-hid", features = ["defmt"] } | ||
| 16 | embassy-usb-ncm = { version = "0.1.0", path = "../../embassy-usb-ncm", features = ["defmt"] } | ||
| 17 | embassy-net = { version = "0.1.0", path = "../../embassy-net", features = ["defmt", "nightly", "tcp", "dhcpv4", "medium-ethernet", "pool-16"] } | 14 | embassy-net = { version = "0.1.0", path = "../../embassy-net", features = ["defmt", "nightly", "tcp", "dhcpv4", "medium-ethernet", "pool-16"] } |
| 15 | embassy-futures = { version = "0.1.0", path = "../../embassy-futures" } | ||
| 18 | usbd-hid = "0.6.0" | 16 | usbd-hid = "0.6.0" |
| 19 | 17 | ||
| 20 | defmt = "0.3" | 18 | defmt = "0.3" |
diff --git a/examples/stm32l5/src/bin/usb_ethernet.rs b/examples/stm32l5/src/bin/usb_ethernet.rs index 2c8706e41..4f36d3f5a 100644 --- a/examples/stm32l5/src/bin/usb_ethernet.rs +++ b/examples/stm32l5/src/bin/usb_ethernet.rs | |||
| @@ -1,6 +1,5 @@ | |||
| 1 | #![no_std] | 1 | #![no_std] |
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | #![feature(generic_associated_types)] | ||
| 4 | #![feature(type_alias_impl_trait)] | 3 | #![feature(type_alias_impl_trait)] |
| 5 | 4 | ||
| 6 | use core::sync::atomic::{AtomicBool, Ordering}; | 5 | use core::sync::atomic::{AtomicBool, Ordering}; |
| @@ -16,8 +15,8 @@ use embassy_stm32::usb::Driver; | |||
| 16 | use embassy_stm32::{interrupt, Config}; | 15 | use embassy_stm32::{interrupt, Config}; |
| 17 | use embassy_sync::blocking_mutex::raw::ThreadModeRawMutex; | 16 | use embassy_sync::blocking_mutex::raw::ThreadModeRawMutex; |
| 18 | use embassy_sync::channel::Channel; | 17 | use embassy_sync::channel::Channel; |
| 18 | use embassy_usb::class::cdc_ncm::{CdcNcmClass, Receiver, Sender, State}; | ||
| 19 | use embassy_usb::{Builder, UsbDevice}; | 19 | use embassy_usb::{Builder, UsbDevice}; |
| 20 | use embassy_usb_ncm::{CdcNcmClass, Receiver, Sender, State}; | ||
| 21 | use embedded_io::asynch::Write; | 20 | use embedded_io::asynch::Write; |
| 22 | use rand_core::RngCore; | 21 | use rand_core::RngCore; |
| 23 | use static_cell::StaticCell; | 22 | use static_cell::StaticCell; |
diff --git a/examples/stm32l5/src/bin/usb_hid_mouse.rs b/examples/stm32l5/src/bin/usb_hid_mouse.rs index 7d763e7fd..d38ed7496 100644 --- a/examples/stm32l5/src/bin/usb_hid_mouse.rs +++ b/examples/stm32l5/src/bin/usb_hid_mouse.rs | |||
| @@ -1,18 +1,17 @@ | |||
| 1 | #![no_std] | 1 | #![no_std] |
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | #![feature(generic_associated_types)] | ||
| 4 | #![feature(type_alias_impl_trait)] | 3 | #![feature(type_alias_impl_trait)] |
| 5 | 4 | ||
| 6 | use defmt::*; | 5 | use defmt::*; |
| 7 | use embassy_executor::Spawner; | 6 | use embassy_executor::Spawner; |
| 7 | use embassy_futures::join::join; | ||
| 8 | use embassy_stm32::rcc::*; | 8 | use embassy_stm32::rcc::*; |
| 9 | use embassy_stm32::usb::Driver; | 9 | use embassy_stm32::usb::Driver; |
| 10 | use embassy_stm32::{interrupt, Config}; | 10 | use embassy_stm32::{interrupt, Config}; |
| 11 | use embassy_time::{Duration, Timer}; | 11 | use embassy_time::{Duration, Timer}; |
| 12 | use embassy_usb::class::hid::{HidWriter, ReportId, RequestHandler, State}; | ||
| 12 | use embassy_usb::control::OutResponse; | 13 | use embassy_usb::control::OutResponse; |
| 13 | use embassy_usb::Builder; | 14 | use embassy_usb::Builder; |
| 14 | use embassy_usb_hid::{HidWriter, ReportId, RequestHandler, State}; | ||
| 15 | use futures::future::join; | ||
| 16 | use usbd_hid::descriptor::{MouseReport, SerializedDescriptor}; | 15 | use usbd_hid::descriptor::{MouseReport, SerializedDescriptor}; |
| 17 | use {defmt_rtt as _, panic_probe as _}; | 16 | use {defmt_rtt as _, panic_probe as _}; |
| 18 | 17 | ||
| @@ -56,7 +55,7 @@ async fn main(_spawner: Spawner) { | |||
| 56 | ); | 55 | ); |
| 57 | 56 | ||
| 58 | // Create classes on the builder. | 57 | // Create classes on the builder. |
| 59 | let config = embassy_usb_hid::Config { | 58 | let config = embassy_usb::class::hid::Config { |
| 60 | report_descriptor: MouseReport::desc(), | 59 | report_descriptor: MouseReport::desc(), |
| 61 | request_handler: Some(&request_handler), | 60 | request_handler: Some(&request_handler), |
| 62 | poll_ms: 60, | 61 | poll_ms: 60, |
diff --git a/examples/stm32l5/src/bin/usb_serial.rs b/examples/stm32l5/src/bin/usb_serial.rs index b576a7353..7562a4e96 100644 --- a/examples/stm32l5/src/bin/usb_serial.rs +++ b/examples/stm32l5/src/bin/usb_serial.rs | |||
| @@ -4,13 +4,13 @@ | |||
| 4 | 4 | ||
| 5 | use defmt::{panic, *}; | 5 | use defmt::{panic, *}; |
| 6 | use embassy_executor::Spawner; | 6 | use embassy_executor::Spawner; |
| 7 | use embassy_futures::join::join; | ||
| 7 | use embassy_stm32::rcc::*; | 8 | use embassy_stm32::rcc::*; |
| 8 | use embassy_stm32::usb::{Driver, Instance}; | 9 | use embassy_stm32::usb::{Driver, Instance}; |
| 9 | use embassy_stm32::{interrupt, Config}; | 10 | use embassy_stm32::{interrupt, Config}; |
| 11 | use embassy_usb::class::cdc_acm::{CdcAcmClass, State}; | ||
| 10 | use embassy_usb::driver::EndpointError; | 12 | use embassy_usb::driver::EndpointError; |
| 11 | use embassy_usb::Builder; | 13 | use embassy_usb::Builder; |
| 12 | use embassy_usb_serial::{CdcAcmClass, State}; | ||
| 13 | use futures::future::join; | ||
| 14 | use {defmt_rtt as _, panic_probe as _}; | 14 | use {defmt_rtt as _, panic_probe as _}; |
| 15 | 15 | ||
| 16 | #[embassy_executor::main] | 16 | #[embassy_executor::main] |
diff --git a/examples/stm32wl/src/bin/lorawan.rs b/examples/stm32wl/src/bin/lorawan.rs index 9143e64da..7f34dd306 100644 --- a/examples/stm32wl/src/bin/lorawan.rs +++ b/examples/stm32wl/src/bin/lorawan.rs | |||
| @@ -2,7 +2,6 @@ | |||
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | #![macro_use] | 3 | #![macro_use] |
| 4 | #![allow(dead_code)] | 4 | #![allow(dead_code)] |
| 5 | #![feature(generic_associated_types)] | ||
| 6 | #![feature(type_alias_impl_trait)] | 5 | #![feature(type_alias_impl_trait)] |
| 7 | 6 | ||
| 8 | use embassy_executor::Spawner; | 7 | use embassy_executor::Spawner; |
diff --git a/examples/stm32wl/src/bin/subghz.rs b/examples/stm32wl/src/bin/subghz.rs index 8f674d796..32c8b5515 100644 --- a/examples/stm32wl/src/bin/subghz.rs +++ b/examples/stm32wl/src/bin/subghz.rs | |||
| @@ -2,7 +2,6 @@ | |||
| 2 | #![no_main] | 2 | #![no_main] |
| 3 | #![macro_use] | 3 | #![macro_use] |
| 4 | #![allow(dead_code)] | 4 | #![allow(dead_code)] |
| 5 | #![feature(generic_associated_types)] | ||
| 6 | #![feature(type_alias_impl_trait)] | 5 | #![feature(type_alias_impl_trait)] |
| 7 | 6 | ||
| 8 | use defmt::*; | 7 | use defmt::*; |
| @@ -13,6 +12,7 @@ use embassy_stm32::gpio::{Input, Level, Output, Pull, Speed}; | |||
| 13 | use embassy_stm32::interrupt; | 12 | use embassy_stm32::interrupt; |
| 14 | use embassy_stm32::interrupt::{Interrupt, InterruptExt}; | 13 | use embassy_stm32::interrupt::{Interrupt, InterruptExt}; |
| 15 | use embassy_stm32::subghz::*; | 14 | use embassy_stm32::subghz::*; |
| 15 | use embassy_sync::blocking_mutex::raw::CriticalSectionRawMutex; | ||
| 16 | use embassy_sync::signal::Signal; | 16 | use embassy_sync::signal::Signal; |
| 17 | use {defmt_rtt as _, panic_probe as _}; | 17 | use {defmt_rtt as _, panic_probe as _}; |
| 18 | 18 | ||
| @@ -65,7 +65,7 @@ async fn main(_spawner: Spawner) { | |||
| 65 | let button = Input::new(p.PA0, Pull::Up); | 65 | let button = Input::new(p.PA0, Pull::Up); |
| 66 | let mut pin = ExtiInput::new(button, p.EXTI0); | 66 | let mut pin = ExtiInput::new(button, p.EXTI0); |
| 67 | 67 | ||
| 68 | static IRQ_SIGNAL: Signal<()> = Signal::new(); | 68 | static IRQ_SIGNAL: Signal<CriticalSectionRawMutex, ()> = Signal::new(); |
| 69 | let radio_irq = interrupt::take!(SUBGHZ_RADIO); | 69 | let radio_irq = interrupt::take!(SUBGHZ_RADIO); |
| 70 | radio_irq.set_handler(|_| { | 70 | radio_irq.set_handler(|_| { |
| 71 | IRQ_SIGNAL.signal(()); | 71 | IRQ_SIGNAL.signal(()); |
