diff options
| author | Quentin Smith <[email protected]> | 2022-08-23 23:01:51 -0400 |
|---|---|---|
| committer | Quentin Smith <[email protected]> | 2022-08-23 23:01:51 -0400 |
| commit | 2900ab79e7afa0ca3e0d800f8a91c3253a333db1 (patch) | |
| tree | a5066235f8b1ac6c2520105db2e5c48630bc006d /examples/nrf/src | |
| parent | 14eae9ca06f63a69ccc29d5fd9e1dec3848a3e98 (diff) | |
| parent | 529535194d4b5d58b31fd6a7541176105e3c63f7 (diff) | |
Merge remote-tracking branch 'origin/master' into nrf-pdm
Diffstat (limited to 'examples/nrf/src')
| -rw-r--r-- | examples/nrf/src/bin/channel.rs | 4 | ||||
| -rw-r--r-- | examples/nrf/src/bin/channel_sender_receiver.rs | 10 | ||||
| -rw-r--r-- | examples/nrf/src/bin/multiprio.rs | 14 | ||||
| -rw-r--r-- | examples/nrf/src/bin/mutex.rs | 4 | ||||
| -rw-r--r-- | examples/nrf/src/bin/pubsub.rs | 4 | ||||
| -rw-r--r-- | examples/nrf/src/bin/raw_spawn.rs | 6 | ||||
| -rw-r--r-- | examples/nrf/src/bin/uart_split.rs | 4 | ||||
| -rw-r--r-- | examples/nrf/src/bin/usb_ethernet.rs | 18 | ||||
| -rw-r--r-- | examples/nrf/src/bin/usb_hid_keyboard.rs | 4 | ||||
| -rw-r--r-- | examples/nrf/src/bin/usb_serial_multitask.rs | 6 |
10 files changed, 37 insertions, 37 deletions
diff --git a/examples/nrf/src/bin/channel.rs b/examples/nrf/src/bin/channel.rs index 195200988..d782a79e7 100644 --- a/examples/nrf/src/bin/channel.rs +++ b/examples/nrf/src/bin/channel.rs | |||
| @@ -5,9 +5,9 @@ | |||
| 5 | use defmt::unwrap; | 5 | use defmt::unwrap; |
| 6 | use embassy_executor::Spawner; | 6 | use embassy_executor::Spawner; |
| 7 | use embassy_nrf::gpio::{Level, Output, OutputDrive}; | 7 | use embassy_nrf::gpio::{Level, Output, OutputDrive}; |
| 8 | use embassy_sync::blocking_mutex::raw::ThreadModeRawMutex; | ||
| 9 | use embassy_sync::channel::Channel; | ||
| 8 | use embassy_time::{Duration, Timer}; | 10 | use embassy_time::{Duration, Timer}; |
| 9 | use embassy_util::blocking_mutex::raw::ThreadModeRawMutex; | ||
| 10 | use embassy_util::channel::mpmc::Channel; | ||
| 11 | use {defmt_rtt as _, panic_probe as _}; | 11 | use {defmt_rtt as _, panic_probe as _}; |
| 12 | 12 | ||
| 13 | enum LedState { | 13 | enum LedState { |
diff --git a/examples/nrf/src/bin/channel_sender_receiver.rs b/examples/nrf/src/bin/channel_sender_receiver.rs index c9c458aec..fcccdaed5 100644 --- a/examples/nrf/src/bin/channel_sender_receiver.rs +++ b/examples/nrf/src/bin/channel_sender_receiver.rs | |||
| @@ -5,10 +5,10 @@ | |||
| 5 | use defmt::unwrap; | 5 | use defmt::unwrap; |
| 6 | use embassy_executor::Spawner; | 6 | use embassy_executor::Spawner; |
| 7 | use embassy_nrf::gpio::{AnyPin, Level, Output, OutputDrive, Pin}; | 7 | use embassy_nrf::gpio::{AnyPin, Level, Output, OutputDrive, Pin}; |
| 8 | use embassy_sync::blocking_mutex::raw::NoopRawMutex; | ||
| 9 | use embassy_sync::channel::{Channel, Receiver, Sender}; | ||
| 8 | use embassy_time::{Duration, Timer}; | 10 | use embassy_time::{Duration, Timer}; |
| 9 | use embassy_util::blocking_mutex::raw::NoopRawMutex; | 11 | use static_cell::StaticCell; |
| 10 | use embassy_util::channel::mpmc::{Channel, Receiver, Sender}; | ||
| 11 | use embassy_util::Forever; | ||
| 12 | use {defmt_rtt as _, panic_probe as _}; | 12 | use {defmt_rtt as _, panic_probe as _}; |
| 13 | 13 | ||
| 14 | enum LedState { | 14 | enum LedState { |
| @@ -16,7 +16,7 @@ enum LedState { | |||
| 16 | Off, | 16 | Off, |
| 17 | } | 17 | } |
| 18 | 18 | ||
| 19 | static CHANNEL: Forever<Channel<NoopRawMutex, LedState, 1>> = Forever::new(); | 19 | static CHANNEL: StaticCell<Channel<NoopRawMutex, LedState, 1>> = StaticCell::new(); |
| 20 | 20 | ||
| 21 | #[embassy_executor::task] | 21 | #[embassy_executor::task] |
| 22 | async fn send_task(sender: Sender<'static, NoopRawMutex, LedState, 1>) { | 22 | async fn send_task(sender: Sender<'static, NoopRawMutex, LedState, 1>) { |
| @@ -43,7 +43,7 @@ async fn recv_task(led: AnyPin, receiver: Receiver<'static, NoopRawMutex, LedSta | |||
| 43 | #[embassy_executor::main] | 43 | #[embassy_executor::main] |
| 44 | async fn main(spawner: Spawner) { | 44 | async fn main(spawner: Spawner) { |
| 45 | let p = embassy_nrf::init(Default::default()); | 45 | let p = embassy_nrf::init(Default::default()); |
| 46 | let channel = CHANNEL.put(Channel::new()); | 46 | let channel = CHANNEL.init(Channel::new()); |
| 47 | 47 | ||
| 48 | unwrap!(spawner.spawn(send_task(channel.sender()))); | 48 | unwrap!(spawner.spawn(send_task(channel.sender()))); |
| 49 | unwrap!(spawner.spawn(recv_task(p.P0_13.degrade(), channel.receiver()))); | 49 | unwrap!(spawner.spawn(recv_task(p.P0_13.degrade(), channel.receiver()))); |
diff --git a/examples/nrf/src/bin/multiprio.rs b/examples/nrf/src/bin/multiprio.rs index b653689a7..25806ae48 100644 --- a/examples/nrf/src/bin/multiprio.rs +++ b/examples/nrf/src/bin/multiprio.rs | |||
| @@ -63,7 +63,7 @@ use embassy_nrf::executor::{Executor, InterruptExecutor}; | |||
| 63 | use embassy_nrf::interrupt; | 63 | use embassy_nrf::interrupt; |
| 64 | use embassy_nrf::interrupt::InterruptExt; | 64 | use embassy_nrf::interrupt::InterruptExt; |
| 65 | use embassy_time::{Duration, Instant, Timer}; | 65 | use embassy_time::{Duration, Instant, Timer}; |
| 66 | use embassy_util::Forever; | 66 | use static_cell::StaticCell; |
| 67 | use {defmt_rtt as _, panic_probe as _}; | 67 | use {defmt_rtt as _, panic_probe as _}; |
| 68 | 68 | ||
| 69 | #[embassy_executor::task] | 69 | #[embassy_executor::task] |
| @@ -108,9 +108,9 @@ async fn run_low() { | |||
| 108 | } | 108 | } |
| 109 | } | 109 | } |
| 110 | 110 | ||
| 111 | static EXECUTOR_HIGH: Forever<InterruptExecutor<interrupt::SWI1_EGU1>> = Forever::new(); | 111 | static EXECUTOR_HIGH: StaticCell<InterruptExecutor<interrupt::SWI1_EGU1>> = StaticCell::new(); |
| 112 | static EXECUTOR_MED: Forever<InterruptExecutor<interrupt::SWI0_EGU0>> = Forever::new(); | 112 | static EXECUTOR_MED: StaticCell<InterruptExecutor<interrupt::SWI0_EGU0>> = StaticCell::new(); |
| 113 | static EXECUTOR_LOW: Forever<Executor> = Forever::new(); | 113 | static EXECUTOR_LOW: StaticCell<Executor> = StaticCell::new(); |
| 114 | 114 | ||
| 115 | #[entry] | 115 | #[entry] |
| 116 | fn main() -> ! { | 116 | fn main() -> ! { |
| @@ -121,19 +121,19 @@ fn main() -> ! { | |||
| 121 | // High-priority executor: SWI1_EGU1, priority level 6 | 121 | // High-priority executor: SWI1_EGU1, priority level 6 |
| 122 | let irq = interrupt::take!(SWI1_EGU1); | 122 | let irq = interrupt::take!(SWI1_EGU1); |
| 123 | irq.set_priority(interrupt::Priority::P6); | 123 | irq.set_priority(interrupt::Priority::P6); |
| 124 | let executor = EXECUTOR_HIGH.put(InterruptExecutor::new(irq)); | 124 | let executor = EXECUTOR_HIGH.init(InterruptExecutor::new(irq)); |
| 125 | let spawner = executor.start(); | 125 | let spawner = executor.start(); |
| 126 | unwrap!(spawner.spawn(run_high())); | 126 | unwrap!(spawner.spawn(run_high())); |
| 127 | 127 | ||
| 128 | // Medium-priority executor: SWI0_EGU0, priority level 7 | 128 | // Medium-priority executor: SWI0_EGU0, priority level 7 |
| 129 | let irq = interrupt::take!(SWI0_EGU0); | 129 | let irq = interrupt::take!(SWI0_EGU0); |
| 130 | irq.set_priority(interrupt::Priority::P7); | 130 | irq.set_priority(interrupt::Priority::P7); |
| 131 | let executor = EXECUTOR_MED.put(InterruptExecutor::new(irq)); | 131 | let executor = EXECUTOR_MED.init(InterruptExecutor::new(irq)); |
| 132 | let spawner = executor.start(); | 132 | let spawner = executor.start(); |
| 133 | unwrap!(spawner.spawn(run_med())); | 133 | unwrap!(spawner.spawn(run_med())); |
| 134 | 134 | ||
| 135 | // Low priority executor: runs in thread mode, using WFE/SEV | 135 | // Low priority executor: runs in thread mode, using WFE/SEV |
| 136 | let executor = EXECUTOR_LOW.put(Executor::new()); | 136 | let executor = EXECUTOR_LOW.init(Executor::new()); |
| 137 | executor.run(|spawner| { | 137 | executor.run(|spawner| { |
| 138 | unwrap!(spawner.spawn(run_low())); | 138 | unwrap!(spawner.spawn(run_low())); |
| 139 | }); | 139 | }); |
diff --git a/examples/nrf/src/bin/mutex.rs b/examples/nrf/src/bin/mutex.rs index 876297883..c402c6ba1 100644 --- a/examples/nrf/src/bin/mutex.rs +++ b/examples/nrf/src/bin/mutex.rs | |||
| @@ -4,9 +4,9 @@ | |||
| 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::ThreadModeRawMutex; | ||
| 8 | use embassy_sync::mutex::Mutex; | ||
| 7 | use embassy_time::{Duration, Timer}; | 9 | use embassy_time::{Duration, Timer}; |
| 8 | use embassy_util::blocking_mutex::raw::ThreadModeRawMutex; | ||
| 9 | use embassy_util::mutex::Mutex; | ||
| 10 | use {defmt_rtt as _, panic_probe as _}; | 10 | use {defmt_rtt as _, panic_probe as _}; |
| 11 | 11 | ||
| 12 | static MUTEX: Mutex<ThreadModeRawMutex, u32> = Mutex::new(0); | 12 | static MUTEX: Mutex<ThreadModeRawMutex, u32> = Mutex::new(0); |
diff --git a/examples/nrf/src/bin/pubsub.rs b/examples/nrf/src/bin/pubsub.rs index 1d90217f2..688e6d075 100644 --- a/examples/nrf/src/bin/pubsub.rs +++ b/examples/nrf/src/bin/pubsub.rs | |||
| @@ -4,9 +4,9 @@ | |||
| 4 | 4 | ||
| 5 | use defmt::unwrap; | 5 | use defmt::unwrap; |
| 6 | use embassy_executor::Spawner; | 6 | use embassy_executor::Spawner; |
| 7 | use embassy_sync::blocking_mutex::raw::ThreadModeRawMutex; | ||
| 8 | use embassy_sync::pubsub::{DynSubscriber, PubSubChannel, Subscriber}; | ||
| 7 | use embassy_time::{Duration, Timer}; | 9 | use embassy_time::{Duration, Timer}; |
| 8 | use embassy_util::blocking_mutex::raw::ThreadModeRawMutex; | ||
| 9 | use embassy_util::channel::pubsub::{DynSubscriber, PubSubChannel, Subscriber}; | ||
| 10 | use {defmt_rtt as _, panic_probe as _}; | 10 | use {defmt_rtt as _, panic_probe as _}; |
| 11 | 11 | ||
| 12 | /// Create the message bus. It has a queue of 4, supports 3 subscribers and 1 publisher | 12 | /// Create the message bus. It has a queue of 4, supports 3 subscribers and 1 publisher |
diff --git a/examples/nrf/src/bin/raw_spawn.rs b/examples/nrf/src/bin/raw_spawn.rs index 415579be7..1b067f5e4 100644 --- a/examples/nrf/src/bin/raw_spawn.rs +++ b/examples/nrf/src/bin/raw_spawn.rs | |||
| @@ -8,7 +8,7 @@ use defmt::{info, unwrap}; | |||
| 8 | use embassy_executor::raw::TaskStorage; | 8 | use embassy_executor::raw::TaskStorage; |
| 9 | use embassy_executor::Executor; | 9 | use embassy_executor::Executor; |
| 10 | use embassy_time::{Duration, Timer}; | 10 | use embassy_time::{Duration, Timer}; |
| 11 | use embassy_util::Forever; | 11 | use static_cell::StaticCell; |
| 12 | use {defmt_rtt as _, panic_probe as _}; | 12 | use {defmt_rtt as _, panic_probe as _}; |
| 13 | 13 | ||
| 14 | async fn run1() { | 14 | async fn run1() { |
| @@ -25,14 +25,14 @@ async fn run2() { | |||
| 25 | } | 25 | } |
| 26 | } | 26 | } |
| 27 | 27 | ||
| 28 | static EXECUTOR: Forever<Executor> = Forever::new(); | 28 | static EXECUTOR: StaticCell<Executor> = StaticCell::new(); |
| 29 | 29 | ||
| 30 | #[entry] | 30 | #[entry] |
| 31 | fn main() -> ! { | 31 | fn main() -> ! { |
| 32 | info!("Hello World!"); | 32 | info!("Hello World!"); |
| 33 | 33 | ||
| 34 | let _p = embassy_nrf::init(Default::default()); | 34 | let _p = embassy_nrf::init(Default::default()); |
| 35 | let executor = EXECUTOR.put(Executor::new()); | 35 | let executor = EXECUTOR.init(Executor::new()); |
| 36 | 36 | ||
| 37 | let run1_task = TaskStorage::new(); | 37 | let run1_task = TaskStorage::new(); |
| 38 | let run2_task = TaskStorage::new(); | 38 | let run2_task = TaskStorage::new(); |
diff --git a/examples/nrf/src/bin/uart_split.rs b/examples/nrf/src/bin/uart_split.rs index dab8e475d..1adaf53fd 100644 --- a/examples/nrf/src/bin/uart_split.rs +++ b/examples/nrf/src/bin/uart_split.rs | |||
| @@ -7,8 +7,8 @@ use embassy_executor::Spawner; | |||
| 7 | use embassy_nrf::peripherals::UARTE0; | 7 | use embassy_nrf::peripherals::UARTE0; |
| 8 | use embassy_nrf::uarte::UarteRx; | 8 | use embassy_nrf::uarte::UarteRx; |
| 9 | use embassy_nrf::{interrupt, uarte}; | 9 | use embassy_nrf::{interrupt, uarte}; |
| 10 | use embassy_util::blocking_mutex::raw::ThreadModeRawMutex; | 10 | use embassy_sync::blocking_mutex::raw::ThreadModeRawMutex; |
| 11 | use embassy_util::channel::mpmc::Channel; | 11 | use embassy_sync::channel::Channel; |
| 12 | use {defmt_rtt as _, panic_probe as _}; | 12 | use {defmt_rtt as _, panic_probe as _}; |
| 13 | 13 | ||
| 14 | static CHANNEL: Channel<ThreadModeRawMutex, [u8; 8], 1> = Channel::new(); | 14 | static CHANNEL: Channel<ThreadModeRawMutex, [u8; 8], 1> = Channel::new(); |
diff --git a/examples/nrf/src/bin/usb_ethernet.rs b/examples/nrf/src/bin/usb_ethernet.rs index f0a870317..ca6c7e0d1 100644 --- a/examples/nrf/src/bin/usb_ethernet.rs +++ b/examples/nrf/src/bin/usb_ethernet.rs | |||
| @@ -14,21 +14,21 @@ use embassy_net::{PacketBox, PacketBoxExt, PacketBuf, Stack, StackResources}; | |||
| 14 | use embassy_nrf::rng::Rng; | 14 | use embassy_nrf::rng::Rng; |
| 15 | use embassy_nrf::usb::{Driver, PowerUsb}; | 15 | use embassy_nrf::usb::{Driver, PowerUsb}; |
| 16 | use embassy_nrf::{interrupt, pac, peripherals}; | 16 | use embassy_nrf::{interrupt, pac, peripherals}; |
| 17 | use embassy_sync::blocking_mutex::raw::ThreadModeRawMutex; | ||
| 18 | use embassy_sync::channel::Channel; | ||
| 17 | use embassy_usb::{Builder, Config, UsbDevice}; | 19 | use embassy_usb::{Builder, Config, UsbDevice}; |
| 18 | use embassy_usb_ncm::{CdcNcmClass, Receiver, Sender, State}; | 20 | use embassy_usb_ncm::{CdcNcmClass, Receiver, Sender, State}; |
| 19 | use embassy_util::blocking_mutex::raw::ThreadModeRawMutex; | ||
| 20 | use embassy_util::channel::mpmc::Channel; | ||
| 21 | use embassy_util::Forever; | ||
| 22 | use embedded_io::asynch::{Read, Write}; | 21 | use embedded_io::asynch::{Read, Write}; |
| 22 | use static_cell::StaticCell; | ||
| 23 | use {defmt_rtt as _, panic_probe as _}; | 23 | use {defmt_rtt as _, panic_probe as _}; |
| 24 | 24 | ||
| 25 | type MyDriver = Driver<'static, peripherals::USBD, PowerUsb>; | 25 | type MyDriver = Driver<'static, peripherals::USBD, PowerUsb>; |
| 26 | 26 | ||
| 27 | macro_rules! forever { | 27 | macro_rules! singleton { |
| 28 | ($val:expr) => {{ | 28 | ($val:expr) => {{ |
| 29 | type T = impl Sized; | 29 | type T = impl Sized; |
| 30 | static FOREVER: Forever<T> = Forever::new(); | 30 | static STATIC_CELL: StaticCell<T> = StaticCell::new(); |
| 31 | FOREVER.put_with(move || $val) | 31 | STATIC_CELL.init_with(move || $val) |
| 32 | }}; | 32 | }}; |
| 33 | } | 33 | } |
| 34 | 34 | ||
| @@ -116,7 +116,7 @@ async fn main(spawner: Spawner) { | |||
| 116 | control_buf: [u8; 128], | 116 | control_buf: [u8; 128], |
| 117 | serial_state: State<'static>, | 117 | serial_state: State<'static>, |
| 118 | } | 118 | } |
| 119 | let res: &mut Resources = forever!(Resources { | 119 | let res: &mut Resources = singleton!(Resources { |
| 120 | device_descriptor: [0; 256], | 120 | device_descriptor: [0; 256], |
| 121 | config_descriptor: [0; 256], | 121 | config_descriptor: [0; 256], |
| 122 | bos_descriptor: [0; 256], | 122 | bos_descriptor: [0; 256], |
| @@ -174,10 +174,10 @@ async fn main(spawner: Spawner) { | |||
| 174 | 174 | ||
| 175 | // Init network stack | 175 | // Init network stack |
| 176 | let device = Device { mac_addr: our_mac_addr }; | 176 | let device = Device { mac_addr: our_mac_addr }; |
| 177 | let stack = &*forever!(Stack::new( | 177 | let stack = &*singleton!(Stack::new( |
| 178 | device, | 178 | device, |
| 179 | config, | 179 | config, |
| 180 | forever!(StackResources::<1, 2, 8>::new()), | 180 | singleton!(StackResources::<1, 2, 8>::new()), |
| 181 | seed | 181 | seed |
| 182 | )); | 182 | )); |
| 183 | 183 | ||
diff --git a/examples/nrf/src/bin/usb_hid_keyboard.rs b/examples/nrf/src/bin/usb_hid_keyboard.rs index cf0078eec..ba2159c72 100644 --- a/examples/nrf/src/bin/usb_hid_keyboard.rs +++ b/examples/nrf/src/bin/usb_hid_keyboard.rs | |||
| @@ -8,14 +8,14 @@ use core::sync::atomic::{AtomicBool, Ordering}; | |||
| 8 | 8 | ||
| 9 | use defmt::*; | 9 | use defmt::*; |
| 10 | use embassy_executor::Spawner; | 10 | use embassy_executor::Spawner; |
| 11 | use embassy_futures::{select, Either}; | ||
| 11 | use embassy_nrf::gpio::{Input, Pin, Pull}; | 12 | use embassy_nrf::gpio::{Input, Pin, Pull}; |
| 12 | use embassy_nrf::usb::{Driver, PowerUsb}; | 13 | use embassy_nrf::usb::{Driver, PowerUsb}; |
| 13 | use embassy_nrf::{interrupt, pac}; | 14 | use embassy_nrf::{interrupt, pac}; |
| 15 | use embassy_sync::signal::Signal; | ||
| 14 | use embassy_usb::control::OutResponse; | 16 | use embassy_usb::control::OutResponse; |
| 15 | use embassy_usb::{Builder, Config, DeviceStateHandler}; | 17 | use embassy_usb::{Builder, Config, DeviceStateHandler}; |
| 16 | use embassy_usb_hid::{HidReaderWriter, ReportId, RequestHandler, State}; | 18 | use embassy_usb_hid::{HidReaderWriter, ReportId, RequestHandler, State}; |
| 17 | use embassy_util::channel::signal::Signal; | ||
| 18 | use embassy_util::{select, Either}; | ||
| 19 | use futures::future::join; | 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 _}; |
diff --git a/examples/nrf/src/bin/usb_serial_multitask.rs b/examples/nrf/src/bin/usb_serial_multitask.rs index 4c1a93087..d62d7e520 100644 --- a/examples/nrf/src/bin/usb_serial_multitask.rs +++ b/examples/nrf/src/bin/usb_serial_multitask.rs | |||
| @@ -12,7 +12,7 @@ use embassy_nrf::{interrupt, pac, peripherals}; | |||
| 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}; | 14 | use embassy_usb_serial::{CdcAcmClass, State}; |
| 15 | use embassy_util::Forever; | 15 | use static_cell::StaticCell; |
| 16 | use {defmt_rtt as _, panic_probe as _}; | 16 | use {defmt_rtt as _, panic_probe as _}; |
| 17 | 17 | ||
| 18 | type MyDriver = Driver<'static, peripherals::USBD, PowerUsb>; | 18 | type MyDriver = Driver<'static, peripherals::USBD, PowerUsb>; |
| @@ -67,8 +67,8 @@ async fn main(spawner: Spawner) { | |||
| 67 | control_buf: [u8; 64], | 67 | control_buf: [u8; 64], |
| 68 | serial_state: State<'static>, | 68 | serial_state: State<'static>, |
| 69 | } | 69 | } |
| 70 | static RESOURCES: Forever<Resources> = Forever::new(); | 70 | static RESOURCES: StaticCell<Resources> = StaticCell::new(); |
| 71 | let res = RESOURCES.put(Resources { | 71 | let res = RESOURCES.init(Resources { |
| 72 | device_descriptor: [0; 256], | 72 | device_descriptor: [0; 256], |
| 73 | config_descriptor: [0; 256], | 73 | config_descriptor: [0; 256], |
| 74 | bos_descriptor: [0; 256], | 74 | bos_descriptor: [0; 256], |
