diff options
| author | Dario Nieuwenhuis <[email protected]> | 2025-09-28 20:58:10 +0000 |
|---|---|---|
| committer | GitHub <[email protected]> | 2025-09-28 20:58:10 +0000 |
| commit | 5fc197529e4260196f99e8d6341a37d7e623c9f6 (patch) | |
| tree | 332718f0fd84026562d3ebd0b1acec60696a9479 /examples | |
| parent | b29c7295e406045ec137b78ca5f220bf7909006b (diff) | |
| parent | 864eaef3a3f7678bcc4ff20b5180b1ce50332fce (diff) | |
Merge pull request #4715 from embassy-rs/nrf-erase
nrf: remove instance generics
Diffstat (limited to 'examples')
| -rw-r--r-- | examples/nrf52840/src/bin/rtc.rs | 3 | ||||
| -rw-r--r-- | examples/nrf52840/src/bin/sixlowpan.rs | 2 | ||||
| -rw-r--r-- | examples/nrf52840/src/bin/uart_split.rs | 2 | ||||
| -rw-r--r-- | examples/nrf52840/src/bin/usb_ethernet.rs | 2 | ||||
| -rw-r--r-- | examples/nrf52840/src/bin/usb_serial.rs | 6 | ||||
| -rw-r--r-- | examples/nrf52840/src/bin/usb_serial_multitask.rs | 2 | ||||
| -rw-r--r-- | examples/nrf52840/src/bin/usb_serial_winusb.rs | 6 | ||||
| -rw-r--r-- | examples/nrf9160/src/bin/modem_tcp_client.rs | 2 |
8 files changed, 10 insertions, 15 deletions
diff --git a/examples/nrf52840/src/bin/rtc.rs b/examples/nrf52840/src/bin/rtc.rs index a3df7da14..9d475df7f 100644 --- a/examples/nrf52840/src/bin/rtc.rs +++ b/examples/nrf52840/src/bin/rtc.rs | |||
| @@ -14,8 +14,7 @@ use {defmt_rtt as _, panic_probe as _}; | |||
| 14 | 14 | ||
| 15 | // 64 bit counter which will never overflow. | 15 | // 64 bit counter which will never overflow. |
| 16 | static TICK_COUNTER: AtomicU64 = AtomicU64::new(0); | 16 | static TICK_COUNTER: AtomicU64 = AtomicU64::new(0); |
| 17 | static RTC: Mutex<CriticalSectionRawMutex, RefCell<Option<Rtc<'static, embassy_nrf::peripherals::RTC0>>>> = | 17 | static RTC: Mutex<CriticalSectionRawMutex, RefCell<Option<Rtc<'static>>>> = Mutex::new(RefCell::new(None)); |
| 18 | Mutex::new(RefCell::new(None)); | ||
| 19 | 18 | ||
| 20 | #[embassy_executor::main] | 19 | #[embassy_executor::main] |
| 21 | async fn main(_spawner: Spawner) { | 20 | async fn main(_spawner: Spawner) { |
diff --git a/examples/nrf52840/src/bin/sixlowpan.rs b/examples/nrf52840/src/bin/sixlowpan.rs index 00a597366..12e385e01 100644 --- a/examples/nrf52840/src/bin/sixlowpan.rs +++ b/examples/nrf52840/src/bin/sixlowpan.rs | |||
| @@ -21,7 +21,7 @@ bind_interrupts!(struct Irqs { | |||
| 21 | }); | 21 | }); |
| 22 | 22 | ||
| 23 | #[embassy_executor::task] | 23 | #[embassy_executor::task] |
| 24 | async fn ieee802154_task(runner: net::Runner<'static, peripherals::RADIO>) -> ! { | 24 | async fn ieee802154_task(runner: net::Runner<'static>) -> ! { |
| 25 | runner.run().await | 25 | runner.run().await |
| 26 | } | 26 | } |
| 27 | 27 | ||
diff --git a/examples/nrf52840/src/bin/uart_split.rs b/examples/nrf52840/src/bin/uart_split.rs index 51af90727..d75143126 100644 --- a/examples/nrf52840/src/bin/uart_split.rs +++ b/examples/nrf52840/src/bin/uart_split.rs | |||
| @@ -52,7 +52,7 @@ async fn main(spawner: Spawner) { | |||
| 52 | } | 52 | } |
| 53 | 53 | ||
| 54 | #[embassy_executor::task] | 54 | #[embassy_executor::task] |
| 55 | async fn reader(mut rx: UarteRx<'static, UARTE0>) { | 55 | async fn reader(mut rx: UarteRx<'static>) { |
| 56 | let mut buf = [0; 8]; | 56 | let mut buf = [0; 8]; |
| 57 | loop { | 57 | loop { |
| 58 | info!("reading..."); | 58 | info!("reading..."); |
diff --git a/examples/nrf52840/src/bin/usb_ethernet.rs b/examples/nrf52840/src/bin/usb_ethernet.rs index 87aa4c6c5..a75b967b4 100644 --- a/examples/nrf52840/src/bin/usb_ethernet.rs +++ b/examples/nrf52840/src/bin/usb_ethernet.rs | |||
| @@ -22,7 +22,7 @@ bind_interrupts!(struct Irqs { | |||
| 22 | RNG => rng::InterruptHandler<peripherals::RNG>; | 22 | RNG => rng::InterruptHandler<peripherals::RNG>; |
| 23 | }); | 23 | }); |
| 24 | 24 | ||
| 25 | type MyDriver = Driver<'static, peripherals::USBD, HardwareVbusDetect>; | 25 | type MyDriver = Driver<'static, HardwareVbusDetect>; |
| 26 | 26 | ||
| 27 | const MTU: usize = 1514; | 27 | const MTU: usize = 1514; |
| 28 | 28 | ||
diff --git a/examples/nrf52840/src/bin/usb_serial.rs b/examples/nrf52840/src/bin/usb_serial.rs index 8d05df791..e7c2d0854 100644 --- a/examples/nrf52840/src/bin/usb_serial.rs +++ b/examples/nrf52840/src/bin/usb_serial.rs | |||
| @@ -5,7 +5,7 @@ use defmt::{info, panic}; | |||
| 5 | use embassy_executor::Spawner; | 5 | use embassy_executor::Spawner; |
| 6 | use embassy_futures::join::join; | 6 | use embassy_futures::join::join; |
| 7 | use embassy_nrf::usb::vbus_detect::{HardwareVbusDetect, VbusDetect}; | 7 | use embassy_nrf::usb::vbus_detect::{HardwareVbusDetect, VbusDetect}; |
| 8 | use embassy_nrf::usb::{Driver, Instance}; | 8 | use embassy_nrf::usb::Driver; |
| 9 | use embassy_nrf::{bind_interrupts, pac, peripherals, usb}; | 9 | use embassy_nrf::{bind_interrupts, pac, peripherals, usb}; |
| 10 | use embassy_usb::class::cdc_acm::{CdcAcmClass, State}; | 10 | use embassy_usb::class::cdc_acm::{CdcAcmClass, State}; |
| 11 | use embassy_usb::driver::EndpointError; | 11 | use embassy_usb::driver::EndpointError; |
| @@ -89,9 +89,7 @@ impl From<EndpointError> for Disconnected { | |||
| 89 | } | 89 | } |
| 90 | } | 90 | } |
| 91 | 91 | ||
| 92 | async fn echo<'d, T: Instance + 'd, P: VbusDetect + 'd>( | 92 | async fn echo<'d, V: VbusDetect + 'd>(class: &mut CdcAcmClass<'d, Driver<'d, V>>) -> Result<(), Disconnected> { |
| 93 | class: &mut CdcAcmClass<'d, Driver<'d, T, P>>, | ||
| 94 | ) -> Result<(), Disconnected> { | ||
| 95 | let mut buf = [0; 64]; | 93 | let mut buf = [0; 64]; |
| 96 | loop { | 94 | loop { |
| 97 | let n = class.read_packet(&mut buf).await?; | 95 | let n = class.read_packet(&mut buf).await?; |
diff --git a/examples/nrf52840/src/bin/usb_serial_multitask.rs b/examples/nrf52840/src/bin/usb_serial_multitask.rs index 00a91a233..b6a983854 100644 --- a/examples/nrf52840/src/bin/usb_serial_multitask.rs +++ b/examples/nrf52840/src/bin/usb_serial_multitask.rs | |||
| @@ -17,7 +17,7 @@ bind_interrupts!(struct Irqs { | |||
| 17 | CLOCK_POWER => usb::vbus_detect::InterruptHandler; | 17 | CLOCK_POWER => usb::vbus_detect::InterruptHandler; |
| 18 | }); | 18 | }); |
| 19 | 19 | ||
| 20 | type MyDriver = Driver<'static, peripherals::USBD, HardwareVbusDetect>; | 20 | type MyDriver = Driver<'static, HardwareVbusDetect>; |
| 21 | 21 | ||
| 22 | #[embassy_executor::task] | 22 | #[embassy_executor::task] |
| 23 | async fn usb_task(mut device: UsbDevice<'static, MyDriver>) { | 23 | async fn usb_task(mut device: UsbDevice<'static, MyDriver>) { |
diff --git a/examples/nrf52840/src/bin/usb_serial_winusb.rs b/examples/nrf52840/src/bin/usb_serial_winusb.rs index 8a20ce673..e30e08a01 100644 --- a/examples/nrf52840/src/bin/usb_serial_winusb.rs +++ b/examples/nrf52840/src/bin/usb_serial_winusb.rs | |||
| @@ -5,7 +5,7 @@ use defmt::{info, panic}; | |||
| 5 | use embassy_executor::Spawner; | 5 | use embassy_executor::Spawner; |
| 6 | use embassy_futures::join::join; | 6 | use embassy_futures::join::join; |
| 7 | use embassy_nrf::usb::vbus_detect::{HardwareVbusDetect, VbusDetect}; | 7 | use embassy_nrf::usb::vbus_detect::{HardwareVbusDetect, VbusDetect}; |
| 8 | use embassy_nrf::usb::{Driver, Instance}; | 8 | use embassy_nrf::usb::Driver; |
| 9 | use embassy_nrf::{bind_interrupts, pac, peripherals, usb}; | 9 | use embassy_nrf::{bind_interrupts, pac, peripherals, usb}; |
| 10 | use embassy_usb::class::cdc_acm::{CdcAcmClass, State}; | 10 | use embassy_usb::class::cdc_acm::{CdcAcmClass, State}; |
| 11 | use embassy_usb::driver::EndpointError; | 11 | use embassy_usb::driver::EndpointError; |
| @@ -108,9 +108,7 @@ impl From<EndpointError> for Disconnected { | |||
| 108 | } | 108 | } |
| 109 | } | 109 | } |
| 110 | 110 | ||
| 111 | async fn echo<'d, T: Instance + 'd, P: VbusDetect + 'd>( | 111 | async fn echo<'d, V: VbusDetect + 'd>(class: &mut CdcAcmClass<'d, Driver<'d, V>>) -> Result<(), Disconnected> { |
| 112 | class: &mut CdcAcmClass<'d, Driver<'d, T, P>>, | ||
| 113 | ) -> Result<(), Disconnected> { | ||
| 114 | let mut buf = [0; 64]; | 112 | let mut buf = [0; 64]; |
| 115 | loop { | 113 | loop { |
| 116 | let n = class.read_packet(&mut buf).await?; | 114 | let n = class.read_packet(&mut buf).await?; |
diff --git a/examples/nrf9160/src/bin/modem_tcp_client.rs b/examples/nrf9160/src/bin/modem_tcp_client.rs index 7d4815699..460a4cfae 100644 --- a/examples/nrf9160/src/bin/modem_tcp_client.rs +++ b/examples/nrf9160/src/bin/modem_tcp_client.rs | |||
| @@ -32,7 +32,7 @@ bind_interrupts!(struct Irqs { | |||
| 32 | }); | 32 | }); |
| 33 | 33 | ||
| 34 | #[embassy_executor::task] | 34 | #[embassy_executor::task] |
| 35 | async fn trace_task(mut uart: BufferedUarteTx<'static, peripherals::SERIAL0>, reader: TraceReader<'static>) -> ! { | 35 | async fn trace_task(mut uart: BufferedUarteTx<'static>, reader: TraceReader<'static>) -> ! { |
| 36 | let mut rx = [0u8; 1024]; | 36 | let mut rx = [0u8; 1024]; |
| 37 | loop { | 37 | loop { |
| 38 | let n = reader.read(&mut rx[..]).await; | 38 | let n = reader.read(&mut rx[..]).await; |
