aboutsummaryrefslogtreecommitdiff
path: root/examples/nrf/src/bin
diff options
context:
space:
mode:
Diffstat (limited to 'examples/nrf/src/bin')
-rw-r--r--examples/nrf/src/bin/awaitable_timer.rs7
-rw-r--r--examples/nrf/src/bin/blinky.rs4
-rw-r--r--examples/nrf/src/bin/buffered_uart.rs8
-rw-r--r--examples/nrf/src/bin/channel.rs4
-rw-r--r--examples/nrf/src/bin/channel_sender_receiver.rs4
-rw-r--r--examples/nrf/src/bin/executor_fairness_test.rs5
-rw-r--r--examples/nrf/src/bin/gpiote_channel.rs4
-rw-r--r--examples/nrf/src/bin/gpiote_port.rs4
-rw-r--r--examples/nrf/src/bin/multiprio.rs4
-rw-r--r--examples/nrf/src/bin/mutex.rs4
-rw-r--r--examples/nrf/src/bin/nvmc.rs4
-rw-r--r--examples/nrf/src/bin/ppi.rs12
-rw-r--r--examples/nrf/src/bin/pwm.rs130
-rw-r--r--examples/nrf/src/bin/pwm_double_sequence.rs7
-rw-r--r--examples/nrf/src/bin/pwm_sequence.rs8
-rw-r--r--examples/nrf/src/bin/pwm_sequence_ppi.rs9
-rw-r--r--examples/nrf/src/bin/pwm_sequence_ws2812b.rs7
-rw-r--r--examples/nrf/src/bin/pwm_servo.rs4
-rw-r--r--examples/nrf/src/bin/qdec.rs11
-rw-r--r--examples/nrf/src/bin/qspi.rs7
-rw-r--r--examples/nrf/src/bin/qspi_lowpower.rs8
-rw-r--r--examples/nrf/src/bin/raw_spawn.rs5
-rw-r--r--examples/nrf/src/bin/rng.rs17
-rw-r--r--examples/nrf/src/bin/saadc.rs4
-rw-r--r--examples/nrf/src/bin/saadc_continuous.rs4
-rw-r--r--examples/nrf/src/bin/self_spawn.rs4
-rw-r--r--examples/nrf/src/bin/self_spawn_current_executor.rs4
-rw-r--r--examples/nrf/src/bin/spim.rs7
-rw-r--r--examples/nrf/src/bin/temp.rs7
-rw-r--r--examples/nrf/src/bin/timer.rs4
-rw-r--r--examples/nrf/src/bin/twim.rs4
-rw-r--r--examples/nrf/src/bin/twim_lowpower.rs5
-rw-r--r--examples/nrf/src/bin/uart.rs4
-rw-r--r--examples/nrf/src/bin/uart_idle.rs8
-rw-r--r--examples/nrf/src/bin/uart_split.rs4
-rw-r--r--examples/nrf/src/bin/usb_ethernet.rs14
-rw-r--r--examples/nrf/src/bin/usb_hid_keyboard.rs21
-rw-r--r--examples/nrf/src/bin/usb_hid_mouse.rs9
-rw-r--r--examples/nrf/src/bin/usb_serial.rs13
-rw-r--r--examples/nrf/src/bin/usb_serial_multitask.rs9
-rw-r--r--examples/nrf/src/bin/wdt.rs4
41 files changed, 138 insertions, 268 deletions
diff --git a/examples/nrf/src/bin/awaitable_timer.rs b/examples/nrf/src/bin/awaitable_timer.rs
index 810b4bd6a..34a657cb9 100644
--- a/examples/nrf/src/bin/awaitable_timer.rs
+++ b/examples/nrf/src/bin/awaitable_timer.rs
@@ -4,12 +4,9 @@
4 4
5use defmt::info; 5use defmt::info;
6use embassy::executor::Spawner; 6use embassy::executor::Spawner;
7use embassy_nrf::interrupt;
8use embassy_nrf::timer::Timer; 7use embassy_nrf::timer::Timer;
9use embassy_nrf::Peripherals; 8use embassy_nrf::{interrupt, Peripherals};
10 9use {defmt_rtt as _, panic_probe as _};
11use defmt_rtt as _; // global logger
12use panic_probe as _;
13 10
14#[embassy::main] 11#[embassy::main]
15async fn main(_spawner: Spawner, p: Peripherals) { 12async fn main(_spawner: Spawner, p: Peripherals) {
diff --git a/examples/nrf/src/bin/blinky.rs b/examples/nrf/src/bin/blinky.rs
index 4828b08fb..23d16f796 100644
--- a/examples/nrf/src/bin/blinky.rs
+++ b/examples/nrf/src/bin/blinky.rs
@@ -6,9 +6,7 @@ use embassy::executor::Spawner;
6use embassy::time::{Duration, Timer}; 6use embassy::time::{Duration, Timer};
7use embassy_nrf::gpio::{Level, Output, OutputDrive}; 7use embassy_nrf::gpio::{Level, Output, OutputDrive};
8use embassy_nrf::Peripherals; 8use embassy_nrf::Peripherals;
9 9use {defmt_rtt as _, panic_probe as _};
10use defmt_rtt as _; // global logger
11use panic_probe as _;
12 10
13#[embassy::main] 11#[embassy::main]
14async fn main(_spawner: Spawner, p: Peripherals) { 12async fn main(_spawner: Spawner, p: Peripherals) {
diff --git a/examples/nrf/src/bin/buffered_uart.rs b/examples/nrf/src/bin/buffered_uart.rs
index 782c39499..18dd698bf 100644
--- a/examples/nrf/src/bin/buffered_uart.rs
+++ b/examples/nrf/src/bin/buffered_uart.rs
@@ -4,13 +4,11 @@
4 4
5use defmt::*; 5use defmt::*;
6use embassy::executor::Spawner; 6use embassy::executor::Spawner;
7use embassy_nrf::buffered_uarte::State; 7use embassy_nrf::buffered_uarte::{BufferedUarte, State};
8use embassy_nrf::{buffered_uarte::BufferedUarte, interrupt, uarte, Peripherals}; 8use embassy_nrf::{interrupt, uarte, Peripherals};
9use embedded_io::asynch::{BufRead, Write}; 9use embedded_io::asynch::{BufRead, Write};
10use futures::pin_mut; 10use futures::pin_mut;
11 11use {defmt_rtt as _, panic_probe as _};
12use defmt_rtt as _; // global logger
13use panic_probe as _;
14 12
15#[embassy::main] 13#[embassy::main]
16async fn main(_spawner: Spawner, p: Peripherals) { 14async fn main(_spawner: Spawner, p: Peripherals) {
diff --git a/examples/nrf/src/bin/channel.rs b/examples/nrf/src/bin/channel.rs
index 12b463581..c57b91a42 100644
--- a/examples/nrf/src/bin/channel.rs
+++ b/examples/nrf/src/bin/channel.rs
@@ -9,9 +9,7 @@ use embassy::executor::Spawner;
9use embassy::time::{Duration, Timer}; 9use embassy::time::{Duration, Timer};
10use embassy_nrf::gpio::{Level, Output, OutputDrive}; 10use embassy_nrf::gpio::{Level, Output, OutputDrive};
11use embassy_nrf::Peripherals; 11use embassy_nrf::Peripherals;
12 12use {defmt_rtt as _, panic_probe as _};
13use defmt_rtt as _; // global logger
14use panic_probe as _;
15 13
16enum LedState { 14enum LedState {
17 On, 15 On,
diff --git a/examples/nrf/src/bin/channel_sender_receiver.rs b/examples/nrf/src/bin/channel_sender_receiver.rs
index 1742dcc9e..847ce2382 100644
--- a/examples/nrf/src/bin/channel_sender_receiver.rs
+++ b/examples/nrf/src/bin/channel_sender_receiver.rs
@@ -10,9 +10,7 @@ use embassy::time::{Duration, Timer};
10use embassy::util::Forever; 10use embassy::util::Forever;
11use embassy_nrf::gpio::{AnyPin, Level, Output, OutputDrive, Pin}; 11use embassy_nrf::gpio::{AnyPin, Level, Output, OutputDrive, Pin};
12use embassy_nrf::Peripherals; 12use embassy_nrf::Peripherals;
13 13use {defmt_rtt as _, panic_probe as _};
14use defmt_rtt as _; // global logger
15use panic_probe as _;
16 14
17enum LedState { 15enum LedState {
18 On, 16 On,
diff --git a/examples/nrf/src/bin/executor_fairness_test.rs b/examples/nrf/src/bin/executor_fairness_test.rs
index 7a356d14b..5a4221519 100644
--- a/examples/nrf/src/bin/executor_fairness_test.rs
+++ b/examples/nrf/src/bin/executor_fairness_test.rs
@@ -3,13 +3,12 @@
3#![feature(type_alias_impl_trait)] 3#![feature(type_alias_impl_trait)]
4 4
5use core::task::Poll; 5use core::task::Poll;
6
6use defmt::{info, unwrap}; 7use defmt::{info, unwrap};
7use embassy::executor::Spawner; 8use embassy::executor::Spawner;
8use embassy::time::{Duration, Instant, Timer}; 9use embassy::time::{Duration, Instant, Timer};
9use embassy_nrf::Peripherals; 10use embassy_nrf::Peripherals;
10 11use {defmt_rtt as _, panic_probe as _};
11use defmt_rtt as _; // global logger
12use panic_probe as _;
13 12
14#[embassy::task] 13#[embassy::task]
15async fn run1() { 14async fn run1() {
diff --git a/examples/nrf/src/bin/gpiote_channel.rs b/examples/nrf/src/bin/gpiote_channel.rs
index 339f779f8..ad8f37c6e 100644
--- a/examples/nrf/src/bin/gpiote_channel.rs
+++ b/examples/nrf/src/bin/gpiote_channel.rs
@@ -7,9 +7,7 @@ use embassy::executor::Spawner;
7use embassy_nrf::gpio::{Input, Pull}; 7use embassy_nrf::gpio::{Input, Pull};
8use embassy_nrf::gpiote::{InputChannel, InputChannelPolarity}; 8use embassy_nrf::gpiote::{InputChannel, InputChannelPolarity};
9use embassy_nrf::Peripherals; 9use embassy_nrf::Peripherals;
10 10use {defmt_rtt as _, panic_probe as _};
11use defmt_rtt as _; // global logger
12use panic_probe as _;
13 11
14#[embassy::main] 12#[embassy::main]
15async fn main(_spawner: Spawner, p: Peripherals) { 13async fn main(_spawner: Spawner, p: Peripherals) {
diff --git a/examples/nrf/src/bin/gpiote_port.rs b/examples/nrf/src/bin/gpiote_port.rs
index dc6bd301f..30b87b3a7 100644
--- a/examples/nrf/src/bin/gpiote_port.rs
+++ b/examples/nrf/src/bin/gpiote_port.rs
@@ -6,9 +6,7 @@ use defmt::{info, unwrap};
6use embassy::executor::Spawner; 6use embassy::executor::Spawner;
7use embassy_nrf::gpio::{AnyPin, Input, Pin as _, Pull}; 7use embassy_nrf::gpio::{AnyPin, Input, Pin as _, Pull};
8use embassy_nrf::Peripherals; 8use embassy_nrf::Peripherals;
9 9use {defmt_rtt as _, panic_probe as _};
10use defmt_rtt as _; // global logger
11use panic_probe as _;
12 10
13#[embassy::task(pool_size = 4)] 11#[embassy::task(pool_size = 4)]
14async fn button_task(n: usize, mut pin: Input<'static, AnyPin>) { 12async fn button_task(n: usize, mut pin: Input<'static, AnyPin>) {
diff --git a/examples/nrf/src/bin/multiprio.rs b/examples/nrf/src/bin/multiprio.rs
index abda18aa5..1a4598e21 100644
--- a/examples/nrf/src/bin/multiprio.rs
+++ b/examples/nrf/src/bin/multiprio.rs
@@ -64,9 +64,7 @@ use embassy::util::Forever;
64use embassy_nrf::executor::{Executor, InterruptExecutor}; 64use embassy_nrf::executor::{Executor, InterruptExecutor};
65use embassy_nrf::interrupt; 65use embassy_nrf::interrupt;
66use embassy_nrf::interrupt::InterruptExt; 66use embassy_nrf::interrupt::InterruptExt;
67 67use {defmt_rtt as _, panic_probe as _};
68use defmt_rtt as _; // global logger
69use panic_probe as _;
70 68
71#[embassy::task] 69#[embassy::task]
72async fn run_high() { 70async fn run_high() {
diff --git a/examples/nrf/src/bin/mutex.rs b/examples/nrf/src/bin/mutex.rs
index db1b72f6d..92e01976c 100644
--- a/examples/nrf/src/bin/mutex.rs
+++ b/examples/nrf/src/bin/mutex.rs
@@ -8,9 +8,7 @@ use embassy::executor::Spawner;
8use embassy::mutex::Mutex; 8use embassy::mutex::Mutex;
9use embassy::time::{Duration, Timer}; 9use embassy::time::{Duration, Timer};
10use embassy_nrf::Peripherals; 10use embassy_nrf::Peripherals;
11 11use {defmt_rtt as _, panic_probe as _};
12use defmt_rtt as _; // global logger
13use panic_probe as _;
14 12
15static MUTEX: Mutex<ThreadModeRawMutex, u32> = Mutex::new(0); 13static MUTEX: Mutex<ThreadModeRawMutex, u32> = Mutex::new(0);
16 14
diff --git a/examples/nrf/src/bin/nvmc.rs b/examples/nrf/src/bin/nvmc.rs
index 7a57399f8..b55ef1f6c 100644
--- a/examples/nrf/src/bin/nvmc.rs
+++ b/examples/nrf/src/bin/nvmc.rs
@@ -8,9 +8,7 @@ use embassy::time::{Duration, Timer};
8use embassy_nrf::nvmc::Nvmc; 8use embassy_nrf::nvmc::Nvmc;
9use embassy_nrf::Peripherals; 9use embassy_nrf::Peripherals;
10use embedded_storage::nor_flash::{NorFlash, ReadNorFlash}; 10use embedded_storage::nor_flash::{NorFlash, ReadNorFlash};
11 11use {defmt_rtt as _, panic_probe as _};
12use defmt_rtt as _; // global logger
13use panic_probe as _;
14 12
15#[embassy::main] 13#[embassy::main]
16async fn main(_spawner: Spawner, p: Peripherals) { 14async fn main(_spawner: Spawner, p: Peripherals) {
diff --git a/examples/nrf/src/bin/ppi.rs b/examples/nrf/src/bin/ppi.rs
index 3c9a8148a..004a1bfa4 100644
--- a/examples/nrf/src/bin/ppi.rs
+++ b/examples/nrf/src/bin/ppi.rs
@@ -3,6 +3,7 @@
3#![feature(type_alias_impl_trait)] 3#![feature(type_alias_impl_trait)]
4 4
5use core::future::pending; 5use core::future::pending;
6
6use defmt::info; 7use defmt::info;
7use embassy::executor::Spawner; 8use embassy::executor::Spawner;
8use embassy_nrf::gpio::{Input, Level, Output, OutputDrive, Pull}; 9use embassy_nrf::gpio::{Input, Level, Output, OutputDrive, Pull};
@@ -10,9 +11,7 @@ use embassy_nrf::gpiote::{self, InputChannel, InputChannelPolarity};
10use embassy_nrf::ppi::Ppi; 11use embassy_nrf::ppi::Ppi;
11use embassy_nrf::Peripherals; 12use embassy_nrf::Peripherals;
12use gpiote::{OutputChannel, OutputChannelPolarity}; 13use gpiote::{OutputChannel, OutputChannelPolarity};
13 14use {defmt_rtt as _, panic_probe as _};
14use defmt_rtt as _; // global logger
15use panic_probe as _;
16 15
17#[embassy::main] 16#[embassy::main]
18async fn main(_spawner: Spawner, p: Peripherals) { 17async fn main(_spawner: Spawner, p: Peripherals) {
@@ -60,12 +59,7 @@ async fn main(_spawner: Spawner, p: Peripherals) {
60 let mut ppi = Ppi::new_one_to_one(p.PPI_CH2, button3.event_in(), led1.task_set()); 59 let mut ppi = Ppi::new_one_to_one(p.PPI_CH2, button3.event_in(), led1.task_set());
61 ppi.enable(); 60 ppi.enable();
62 61
63 let mut ppi = Ppi::new_one_to_two( 62 let mut ppi = Ppi::new_one_to_two(p.PPI_CH3, button4.event_in(), led1.task_out(), led2.task_out());
64 p.PPI_CH3,
65 button4.event_in(),
66 led1.task_out(),
67 led2.task_out(),
68 );
69 ppi.enable(); 63 ppi.enable();
70 64
71 info!("PPI setup!"); 65 info!("PPI setup!");
diff --git a/examples/nrf/src/bin/pwm.rs b/examples/nrf/src/bin/pwm.rs
index 7939e79e4..aec5dd73a 100644
--- a/examples/nrf/src/bin/pwm.rs
+++ b/examples/nrf/src/bin/pwm.rs
@@ -7,81 +7,67 @@ use embassy::executor::Spawner;
7use embassy::time::{Duration, Timer}; 7use embassy::time::{Duration, Timer};
8use embassy_nrf::pwm::{Prescaler, SimplePwm}; 8use embassy_nrf::pwm::{Prescaler, SimplePwm};
9use embassy_nrf::Peripherals; 9use embassy_nrf::Peripherals;
10 10use {defmt_rtt as _, panic_probe as _};
11use defmt_rtt as _; // global logger
12use panic_probe as _;
13 11
14// for i in range(1024): print(int((math.sin(i/512*math.pi)*0.4+0.5)**2*32767), ', ', end='') 12// for i in range(1024): print(int((math.sin(i/512*math.pi)*0.4+0.5)**2*32767), ', ', end='')
15static DUTY: [u16; 1024] = [ 13static DUTY: [u16; 1024] = [
16 8191, 8272, 8353, 8434, 8516, 8598, 8681, 8764, 8847, 8931, 9015, 9099, 9184, 9269, 9354, 9440, 14 8191, 8272, 8353, 8434, 8516, 8598, 8681, 8764, 8847, 8931, 9015, 9099, 9184, 9269, 9354, 9440, 9526, 9613, 9700,
17 9526, 9613, 9700, 9787, 9874, 9962, 10050, 10139, 10227, 10316, 10406, 10495, 10585, 10675, 15 9787, 9874, 9962, 10050, 10139, 10227, 10316, 10406, 10495, 10585, 10675, 10766, 10857, 10948, 11039, 11131, 11223,
18 10766, 10857, 10948, 11039, 11131, 11223, 11315, 11407, 11500, 11592, 11685, 11779, 11872, 16 11315, 11407, 11500, 11592, 11685, 11779, 11872, 11966, 12060, 12154, 12248, 12343, 12438, 12533, 12628, 12723,
19 11966, 12060, 12154, 12248, 12343, 12438, 12533, 12628, 12723, 12818, 12914, 13010, 13106, 17 12818, 12914, 13010, 13106, 13202, 13298, 13394, 13491, 13587, 13684, 13781, 13878, 13975, 14072, 14169, 14266,
20 13202, 13298, 13394, 13491, 13587, 13684, 13781, 13878, 13975, 14072, 14169, 14266, 14364, 18 14364, 14461, 14558, 14656, 14754, 14851, 14949, 15046, 15144, 15242, 15339, 15437, 15535, 15632, 15730, 15828,
21 14461, 14558, 14656, 14754, 14851, 14949, 15046, 15144, 15242, 15339, 15437, 15535, 15632, 19 15925, 16023, 16120, 16218, 16315, 16412, 16510, 16607, 16704, 16801, 16898, 16995, 17091, 17188, 17284, 17380,
22 15730, 15828, 15925, 16023, 16120, 16218, 16315, 16412, 16510, 16607, 16704, 16801, 16898, 20 17477, 17572, 17668, 17764, 17859, 17955, 18050, 18145, 18239, 18334, 18428, 18522, 18616, 18710, 18803, 18896,
23 16995, 17091, 17188, 17284, 17380, 17477, 17572, 17668, 17764, 17859, 17955, 18050, 18145, 21 18989, 19082, 19174, 19266, 19358, 19449, 19540, 19631, 19722, 19812, 19902, 19991, 20081, 20169, 20258, 20346,
24 18239, 18334, 18428, 18522, 18616, 18710, 18803, 18896, 18989, 19082, 19174, 19266, 19358, 22 20434, 20521, 20608, 20695, 20781, 20867, 20952, 21037, 21122, 21206, 21290, 21373, 21456, 21538, 21620, 21701,
25 19449, 19540, 19631, 19722, 19812, 19902, 19991, 20081, 20169, 20258, 20346, 20434, 20521, 23 21782, 21863, 21943, 22022, 22101, 22179, 22257, 22335, 22412, 22488, 22564, 22639, 22714, 22788, 22861, 22934,
26 20608, 20695, 20781, 20867, 20952, 21037, 21122, 21206, 21290, 21373, 21456, 21538, 21620, 24 23007, 23079, 23150, 23220, 23290, 23360, 23429, 23497, 23564, 23631, 23698, 23763, 23828, 23892, 23956, 24019,
27 21701, 21782, 21863, 21943, 22022, 22101, 22179, 22257, 22335, 22412, 22488, 22564, 22639, 25 24081, 24143, 24204, 24264, 24324, 24383, 24441, 24499, 24555, 24611, 24667, 24721, 24775, 24828, 24881, 24933,
28 22714, 22788, 22861, 22934, 23007, 23079, 23150, 23220, 23290, 23360, 23429, 23497, 23564, 26 24983, 25034, 25083, 25132, 25180, 25227, 25273, 25319, 25363, 25407, 25451, 25493, 25535, 25575, 25615, 25655,
29 23631, 23698, 23763, 23828, 23892, 23956, 24019, 24081, 24143, 24204, 24264, 24324, 24383, 27 25693, 25731, 25767, 25803, 25838, 25873, 25906, 25939, 25971, 26002, 26032, 26061, 26089, 26117, 26144, 26170,
30 24441, 24499, 24555, 24611, 24667, 24721, 24775, 24828, 24881, 24933, 24983, 25034, 25083, 28 26195, 26219, 26242, 26264, 26286, 26307, 26327, 26346, 26364, 26381, 26397, 26413, 26427, 26441, 26454, 26466,
31 25132, 25180, 25227, 25273, 25319, 25363, 25407, 25451, 25493, 25535, 25575, 25615, 25655, 29 26477, 26487, 26496, 26505, 26512, 26519, 26525, 26530, 26534, 26537, 26539, 26540, 26541, 26540, 26539, 26537,
32 25693, 25731, 25767, 25803, 25838, 25873, 25906, 25939, 25971, 26002, 26032, 26061, 26089, 30 26534, 26530, 26525, 26519, 26512, 26505, 26496, 26487, 26477, 26466, 26454, 26441, 26427, 26413, 26397, 26381,
33 26117, 26144, 26170, 26195, 26219, 26242, 26264, 26286, 26307, 26327, 26346, 26364, 26381, 31 26364, 26346, 26327, 26307, 26286, 26264, 26242, 26219, 26195, 26170, 26144, 26117, 26089, 26061, 26032, 26002,
34 26397, 26413, 26427, 26441, 26454, 26466, 26477, 26487, 26496, 26505, 26512, 26519, 26525, 32 25971, 25939, 25906, 25873, 25838, 25803, 25767, 25731, 25693, 25655, 25615, 25575, 25535, 25493, 25451, 25407,
35 26530, 26534, 26537, 26539, 26540, 26541, 26540, 26539, 26537, 26534, 26530, 26525, 26519, 33 25363, 25319, 25273, 25227, 25180, 25132, 25083, 25034, 24983, 24933, 24881, 24828, 24775, 24721, 24667, 24611,
36 26512, 26505, 26496, 26487, 26477, 26466, 26454, 26441, 26427, 26413, 26397, 26381, 26364, 34 24555, 24499, 24441, 24383, 24324, 24264, 24204, 24143, 24081, 24019, 23956, 23892, 23828, 23763, 23698, 23631,
37 26346, 26327, 26307, 26286, 26264, 26242, 26219, 26195, 26170, 26144, 26117, 26089, 26061, 35 23564, 23497, 23429, 23360, 23290, 23220, 23150, 23079, 23007, 22934, 22861, 22788, 22714, 22639, 22564, 22488,
38 26032, 26002, 25971, 25939, 25906, 25873, 25838, 25803, 25767, 25731, 25693, 25655, 25615, 36 22412, 22335, 22257, 22179, 22101, 22022, 21943, 21863, 21782, 21701, 21620, 21538, 21456, 21373, 21290, 21206,
39 25575, 25535, 25493, 25451, 25407, 25363, 25319, 25273, 25227, 25180, 25132, 25083, 25034, 37 21122, 21037, 20952, 20867, 20781, 20695, 20608, 20521, 20434, 20346, 20258, 20169, 20081, 19991, 19902, 19812,
40 24983, 24933, 24881, 24828, 24775, 24721, 24667, 24611, 24555, 24499, 24441, 24383, 24324, 38 19722, 19631, 19540, 19449, 19358, 19266, 19174, 19082, 18989, 18896, 18803, 18710, 18616, 18522, 18428, 18334,
41 24264, 24204, 24143, 24081, 24019, 23956, 23892, 23828, 23763, 23698, 23631, 23564, 23497, 39 18239, 18145, 18050, 17955, 17859, 17764, 17668, 17572, 17477, 17380, 17284, 17188, 17091, 16995, 16898, 16801,
42 23429, 23360, 23290, 23220, 23150, 23079, 23007, 22934, 22861, 22788, 22714, 22639, 22564, 40 16704, 16607, 16510, 16412, 16315, 16218, 16120, 16023, 15925, 15828, 15730, 15632, 15535, 15437, 15339, 15242,
43 22488, 22412, 22335, 22257, 22179, 22101, 22022, 21943, 21863, 21782, 21701, 21620, 21538, 41 15144, 15046, 14949, 14851, 14754, 14656, 14558, 14461, 14364, 14266, 14169, 14072, 13975, 13878, 13781, 13684,
44 21456, 21373, 21290, 21206, 21122, 21037, 20952, 20867, 20781, 20695, 20608, 20521, 20434, 42 13587, 13491, 13394, 13298, 13202, 13106, 13010, 12914, 12818, 12723, 12628, 12533, 12438, 12343, 12248, 12154,
45 20346, 20258, 20169, 20081, 19991, 19902, 19812, 19722, 19631, 19540, 19449, 19358, 19266, 43 12060, 11966, 11872, 11779, 11685, 11592, 11500, 11407, 11315, 11223, 11131, 11039, 10948, 10857, 10766, 10675,
46 19174, 19082, 18989, 18896, 18803, 18710, 18616, 18522, 18428, 18334, 18239, 18145, 18050, 44 10585, 10495, 10406, 10316, 10227, 10139, 10050, 9962, 9874, 9787, 9700, 9613, 9526, 9440, 9354, 9269, 9184, 9099,
47 17955, 17859, 17764, 17668, 17572, 17477, 17380, 17284, 17188, 17091, 16995, 16898, 16801, 45 9015, 8931, 8847, 8764, 8681, 8598, 8516, 8434, 8353, 8272, 8191, 8111, 8031, 7952, 7873, 7794, 7716, 7638, 7561,
48 16704, 16607, 16510, 16412, 16315, 16218, 16120, 16023, 15925, 15828, 15730, 15632, 15535, 46 7484, 7407, 7331, 7255, 7180, 7105, 7031, 6957, 6883, 6810, 6738, 6665, 6594, 6522, 6451, 6381, 6311, 6241, 6172,
49 15437, 15339, 15242, 15144, 15046, 14949, 14851, 14754, 14656, 14558, 14461, 14364, 14266, 47 6104, 6036, 5968, 5901, 5834, 5767, 5702, 5636, 5571, 5507, 5443, 5379, 5316, 5253, 5191, 5130, 5068, 5008, 4947,
50 14169, 14072, 13975, 13878, 13781, 13684, 13587, 13491, 13394, 13298, 13202, 13106, 13010, 48 4888, 4828, 4769, 4711, 4653, 4596, 4539, 4482, 4426, 4371, 4316, 4261, 4207, 4153, 4100, 4047, 3995, 3943, 3892,
51 12914, 12818, 12723, 12628, 12533, 12438, 12343, 12248, 12154, 12060, 11966, 11872, 11779, 49 3841, 3791, 3741, 3691, 3642, 3594, 3546, 3498, 3451, 3404, 3358, 3312, 3267, 3222, 3178, 3134, 3090, 3047, 3005,
52 11685, 11592, 11500, 11407, 11315, 11223, 11131, 11039, 10948, 10857, 10766, 10675, 10585, 50 2962, 2921, 2879, 2839, 2798, 2758, 2719, 2680, 2641, 2603, 2565, 2528, 2491, 2454, 2418, 2382, 2347, 2312, 2278,
53 10495, 10406, 10316, 10227, 10139, 10050, 9962, 9874, 9787, 9700, 9613, 9526, 9440, 9354, 9269, 51 2244, 2210, 2177, 2144, 2112, 2080, 2048, 2017, 1986, 1956, 1926, 1896, 1867, 1838, 1810, 1781, 1754, 1726, 1699,
54 9184, 9099, 9015, 8931, 8847, 8764, 8681, 8598, 8516, 8434, 8353, 8272, 8191, 8111, 8031, 7952, 52 1673, 1646, 1620, 1595, 1570, 1545, 1520, 1496, 1472, 1449, 1426, 1403, 1380, 1358, 1336, 1315, 1294, 1273, 1252,
55 7873, 7794, 7716, 7638, 7561, 7484, 7407, 7331, 7255, 7180, 7105, 7031, 6957, 6883, 6810, 6738, 53 1232, 1212, 1192, 1173, 1154, 1135, 1117, 1099, 1081, 1063, 1046, 1029, 1012, 996, 980, 964, 948, 933, 918, 903,
56 6665, 6594, 6522, 6451, 6381, 6311, 6241, 6172, 6104, 6036, 5968, 5901, 5834, 5767, 5702, 5636, 54 888, 874, 860, 846, 833, 819, 806, 793, 781, 768, 756, 744, 733, 721, 710, 699, 688, 677, 667, 657, 647, 637, 627,
57 5571, 5507, 5443, 5379, 5316, 5253, 5191, 5130, 5068, 5008, 4947, 4888, 4828, 4769, 4711, 4653, 55 618, 609, 599, 591, 582, 574, 565, 557, 549, 541, 534, 526, 519, 512, 505, 498, 492, 485, 479, 473, 467, 461, 455,
58 4596, 4539, 4482, 4426, 4371, 4316, 4261, 4207, 4153, 4100, 4047, 3995, 3943, 3892, 3841, 3791, 56 450, 444, 439, 434, 429, 424, 419, 415, 410, 406, 402, 398, 394, 390, 386, 383, 379, 376, 373, 370, 367, 364, 361,
59 3741, 3691, 3642, 3594, 3546, 3498, 3451, 3404, 3358, 3312, 3267, 3222, 3178, 3134, 3090, 3047, 57 359, 356, 354, 351, 349, 347, 345, 343, 342, 340, 338, 337, 336, 334, 333, 332, 331, 330, 330, 329, 328, 328, 328,
60 3005, 2962, 2921, 2879, 2839, 2798, 2758, 2719, 2680, 2641, 2603, 2565, 2528, 2491, 2454, 2418, 58 327, 327, 327, 327, 327, 328, 328, 328, 329, 330, 330, 331, 332, 333, 334, 336, 337, 338, 340, 342, 343, 345, 347,
61 2382, 2347, 2312, 2278, 2244, 2210, 2177, 2144, 2112, 2080, 2048, 2017, 1986, 1956, 1926, 1896, 59 349, 351, 354, 356, 359, 361, 364, 367, 370, 373, 376, 379, 383, 386, 390, 394, 398, 402, 406, 410, 415, 419, 424,
62 1867, 1838, 1810, 1781, 1754, 1726, 1699, 1673, 1646, 1620, 1595, 1570, 1545, 1520, 1496, 1472, 60 429, 434, 439, 444, 450, 455, 461, 467, 473, 479, 485, 492, 498, 505, 512, 519, 526, 534, 541, 549, 557, 565, 574,
63 1449, 1426, 1403, 1380, 1358, 1336, 1315, 1294, 1273, 1252, 1232, 1212, 1192, 1173, 1154, 1135, 61 582, 591, 599, 609, 618, 627, 637, 647, 657, 667, 677, 688, 699, 710, 721, 733, 744, 756, 768, 781, 793, 806, 819,
64 1117, 1099, 1081, 1063, 1046, 1029, 1012, 996, 980, 964, 948, 933, 918, 903, 888, 874, 860, 62 833, 846, 860, 874, 888, 903, 918, 933, 948, 964, 980, 996, 1012, 1029, 1046, 1063, 1081, 1099, 1117, 1135, 1154,
65 846, 833, 819, 806, 793, 781, 768, 756, 744, 733, 721, 710, 699, 688, 677, 667, 657, 647, 637, 63 1173, 1192, 1212, 1232, 1252, 1273, 1294, 1315, 1336, 1358, 1380, 1403, 1426, 1449, 1472, 1496, 1520, 1545, 1570,
66 627, 618, 609, 599, 591, 582, 574, 565, 557, 549, 541, 534, 526, 519, 512, 505, 498, 492, 485, 64 1595, 1620, 1646, 1673, 1699, 1726, 1754, 1781, 1810, 1838, 1867, 1896, 1926, 1956, 1986, 2017, 2048, 2080, 2112,
67 479, 473, 467, 461, 455, 450, 444, 439, 434, 429, 424, 419, 415, 410, 406, 402, 398, 394, 390, 65 2144, 2177, 2210, 2244, 2278, 2312, 2347, 2382, 2418, 2454, 2491, 2528, 2565, 2603, 2641, 2680, 2719, 2758, 2798,
68 386, 383, 379, 376, 373, 370, 367, 364, 361, 359, 356, 354, 351, 349, 347, 345, 343, 342, 340, 66 2839, 2879, 2921, 2962, 3005, 3047, 3090, 3134, 3178, 3222, 3267, 3312, 3358, 3404, 3451, 3498, 3546, 3594, 3642,
69 338, 337, 336, 334, 333, 332, 331, 330, 330, 329, 328, 328, 328, 327, 327, 327, 327, 327, 328, 67 3691, 3741, 3791, 3841, 3892, 3943, 3995, 4047, 4100, 4153, 4207, 4261, 4316, 4371, 4426, 4482, 4539, 4596, 4653,
70 328, 328, 329, 330, 330, 331, 332, 333, 334, 336, 337, 338, 340, 342, 343, 345, 347, 349, 351, 68 4711, 4769, 4828, 4888, 4947, 5008, 5068, 5130, 5191, 5253, 5316, 5379, 5443, 5507, 5571, 5636, 5702, 5767, 5834,
71 354, 356, 359, 361, 364, 367, 370, 373, 376, 379, 383, 386, 390, 394, 398, 402, 406, 410, 415, 69 5901, 5968, 6036, 6104, 6172, 6241, 6311, 6381, 6451, 6522, 6594, 6665, 6738, 6810, 6883, 6957, 7031, 7105, 7180,
72 419, 424, 429, 434, 439, 444, 450, 455, 461, 467, 473, 479, 485, 492, 498, 505, 512, 519, 526, 70 7255, 7331, 7407, 7484, 7561, 7638, 7716, 7794, 7873, 7952, 8031, 8111,
73 534, 541, 549, 557, 565, 574, 582, 591, 599, 609, 618, 627, 637, 647, 657, 667, 677, 688, 699,
74 710, 721, 733, 744, 756, 768, 781, 793, 806, 819, 833, 846, 860, 874, 888, 903, 918, 933, 948,
75 964, 980, 996, 1012, 1029, 1046, 1063, 1081, 1099, 1117, 1135, 1154, 1173, 1192, 1212, 1232,
76 1252, 1273, 1294, 1315, 1336, 1358, 1380, 1403, 1426, 1449, 1472, 1496, 1520, 1545, 1570, 1595,
77 1620, 1646, 1673, 1699, 1726, 1754, 1781, 1810, 1838, 1867, 1896, 1926, 1956, 1986, 2017, 2048,
78 2080, 2112, 2144, 2177, 2210, 2244, 2278, 2312, 2347, 2382, 2418, 2454, 2491, 2528, 2565, 2603,
79 2641, 2680, 2719, 2758, 2798, 2839, 2879, 2921, 2962, 3005, 3047, 3090, 3134, 3178, 3222, 3267,
80 3312, 3358, 3404, 3451, 3498, 3546, 3594, 3642, 3691, 3741, 3791, 3841, 3892, 3943, 3995, 4047,
81 4100, 4153, 4207, 4261, 4316, 4371, 4426, 4482, 4539, 4596, 4653, 4711, 4769, 4828, 4888, 4947,
82 5008, 5068, 5130, 5191, 5253, 5316, 5379, 5443, 5507, 5571, 5636, 5702, 5767, 5834, 5901, 5968,
83 6036, 6104, 6172, 6241, 6311, 6381, 6451, 6522, 6594, 6665, 6738, 6810, 6883, 6957, 7031, 7105,
84 7180, 7255, 7331, 7407, 7484, 7561, 7638, 7716, 7794, 7873, 7952, 8031, 8111,
85]; 71];
86 72
87#[embassy::main] 73#[embassy::main]
diff --git a/examples/nrf/src/bin/pwm_double_sequence.rs b/examples/nrf/src/bin/pwm_double_sequence.rs
index 6fc429214..facafa775 100644
--- a/examples/nrf/src/bin/pwm_double_sequence.rs
+++ b/examples/nrf/src/bin/pwm_double_sequence.rs
@@ -6,13 +6,10 @@ use defmt::*;
6use embassy::executor::Spawner; 6use embassy::executor::Spawner;
7use embassy::time::{Duration, Timer}; 7use embassy::time::{Duration, Timer};
8use embassy_nrf::pwm::{ 8use embassy_nrf::pwm::{
9 Config, Prescaler, Sequence, SequenceConfig, SequenceMode, SequencePwm, Sequencer, 9 Config, Prescaler, Sequence, SequenceConfig, SequenceMode, SequencePwm, Sequencer, StartSequence,
10 StartSequence,
11}; 10};
12use embassy_nrf::Peripherals; 11use embassy_nrf::Peripherals;
13 12use {defmt_rtt as _, panic_probe as _};
14use defmt_rtt as _; // global logger
15use panic_probe as _;
16 13
17#[embassy::main] 14#[embassy::main]
18async fn main(_spawner: Spawner, p: Peripherals) { 15async fn main(_spawner: Spawner, p: Peripherals) {
diff --git a/examples/nrf/src/bin/pwm_sequence.rs b/examples/nrf/src/bin/pwm_sequence.rs
index 3b2919ba5..b7cb385c7 100644
--- a/examples/nrf/src/bin/pwm_sequence.rs
+++ b/examples/nrf/src/bin/pwm_sequence.rs
@@ -5,13 +5,9 @@
5use defmt::*; 5use defmt::*;
6use embassy::executor::Spawner; 6use embassy::executor::Spawner;
7use embassy::time::{Duration, Timer}; 7use embassy::time::{Duration, Timer};
8use embassy_nrf::pwm::{ 8use embassy_nrf::pwm::{Config, Prescaler, SequenceConfig, SequencePwm, SingleSequenceMode, SingleSequencer};
9 Config, Prescaler, SequenceConfig, SequencePwm, SingleSequenceMode, SingleSequencer,
10};
11use embassy_nrf::Peripherals; 9use embassy_nrf::Peripherals;
12 10use {defmt_rtt as _, panic_probe as _};
13use defmt_rtt as _; // global logger
14use panic_probe as _;
15 11
16#[embassy::main] 12#[embassy::main]
17async fn main(_spawner: Spawner, p: Peripherals) { 13async fn main(_spawner: Spawner, p: Peripherals) {
diff --git a/examples/nrf/src/bin/pwm_sequence_ppi.rs b/examples/nrf/src/bin/pwm_sequence_ppi.rs
index 1f3662c60..7d020e48d 100644
--- a/examples/nrf/src/bin/pwm_sequence_ppi.rs
+++ b/examples/nrf/src/bin/pwm_sequence_ppi.rs
@@ -4,18 +4,15 @@
4#![feature(array_from_fn)] 4#![feature(array_from_fn)]
5 5
6use core::future::pending; 6use core::future::pending;
7
7use defmt::*; 8use defmt::*;
8use embassy::executor::Spawner; 9use embassy::executor::Spawner;
9use embassy_nrf::gpio::{Input, Pull}; 10use embassy_nrf::gpio::{Input, Pull};
10use embassy_nrf::gpiote::{InputChannel, InputChannelPolarity}; 11use embassy_nrf::gpiote::{InputChannel, InputChannelPolarity};
11use embassy_nrf::ppi::Ppi; 12use embassy_nrf::ppi::Ppi;
12use embassy_nrf::pwm::{ 13use embassy_nrf::pwm::{Config, Prescaler, SequenceConfig, SequencePwm, SingleSequenceMode, SingleSequencer};
13 Config, Prescaler, SequenceConfig, SequencePwm, SingleSequenceMode, SingleSequencer,
14};
15use embassy_nrf::Peripherals; 14use embassy_nrf::Peripherals;
16 15use {defmt_rtt as _, panic_probe as _};
17use defmt_rtt as _; // global logger
18use panic_probe as _;
19 16
20#[embassy::main] 17#[embassy::main]
21async fn main(_spawner: Spawner, p: Peripherals) { 18async fn main(_spawner: Spawner, p: Peripherals) {
diff --git a/examples/nrf/src/bin/pwm_sequence_ws2812b.rs b/examples/nrf/src/bin/pwm_sequence_ws2812b.rs
index 8bfe1d50f..0dee8c949 100644
--- a/examples/nrf/src/bin/pwm_sequence_ws2812b.rs
+++ b/examples/nrf/src/bin/pwm_sequence_ws2812b.rs
@@ -6,13 +6,10 @@ use defmt::*;
6use embassy::executor::Spawner; 6use embassy::executor::Spawner;
7use embassy::time::{Duration, Timer}; 7use embassy::time::{Duration, Timer};
8use embassy_nrf::pwm::{ 8use embassy_nrf::pwm::{
9 Config, Prescaler, SequenceConfig, SequenceLoad, SequencePwm, SingleSequenceMode, 9 Config, Prescaler, SequenceConfig, SequenceLoad, SequencePwm, SingleSequenceMode, SingleSequencer,
10 SingleSequencer,
11}; 10};
12use embassy_nrf::Peripherals; 11use embassy_nrf::Peripherals;
13 12use {defmt_rtt as _, panic_probe as _};
14use defmt_rtt as _; // global logger
15use panic_probe as _;
16 13
17// WS2812B LED light demonstration. Drives just one light. 14// WS2812B LED light demonstration. Drives just one light.
18// The following reference on WS2812B may be of use: 15// The following reference on WS2812B may be of use:
diff --git a/examples/nrf/src/bin/pwm_servo.rs b/examples/nrf/src/bin/pwm_servo.rs
index 40863bf3c..71a90a948 100644
--- a/examples/nrf/src/bin/pwm_servo.rs
+++ b/examples/nrf/src/bin/pwm_servo.rs
@@ -7,9 +7,7 @@ use embassy::executor::Spawner;
7use embassy::time::{Duration, Timer}; 7use embassy::time::{Duration, Timer};
8use embassy_nrf::pwm::{Prescaler, SimplePwm}; 8use embassy_nrf::pwm::{Prescaler, SimplePwm};
9use embassy_nrf::Peripherals; 9use embassy_nrf::Peripherals;
10 10use {defmt_rtt as _, panic_probe as _};
11use defmt_rtt as _; // global logger
12use panic_probe as _;
13 11
14#[embassy::main] 12#[embassy::main]
15async fn main(_spawner: Spawner, p: Peripherals) { 13async fn main(_spawner: Spawner, p: Peripherals) {
diff --git a/examples/nrf/src/bin/qdec.rs b/examples/nrf/src/bin/qdec.rs
index bf5b11468..9529c7bb6 100644
--- a/examples/nrf/src/bin/qdec.rs
+++ b/examples/nrf/src/bin/qdec.rs
@@ -4,14 +4,9 @@
4 4
5use defmt::info; 5use defmt::info;
6use embassy::executor::Spawner; 6use embassy::executor::Spawner;
7use embassy_nrf::{ 7use embassy_nrf::qdec::{self, Qdec};
8 interrupt, 8use embassy_nrf::{interrupt, Peripherals};
9 qdec::{self, Qdec}, 9use {defmt_rtt as _, panic_probe as _};
10 Peripherals,
11};
12
13use defmt_rtt as _; // global logger
14use panic_probe as _;
15 10
16#[embassy::main] 11#[embassy::main]
17async fn main(_spawner: Spawner, p: Peripherals) { 12async fn main(_spawner: Spawner, p: Peripherals) {
diff --git a/examples/nrf/src/bin/qspi.rs b/examples/nrf/src/bin/qspi.rs
index 8673b7961..96c90f9c8 100644
--- a/examples/nrf/src/bin/qspi.rs
+++ b/examples/nrf/src/bin/qspi.rs
@@ -4,11 +4,8 @@
4 4
5use defmt::{assert_eq, info, unwrap}; 5use defmt::{assert_eq, info, unwrap};
6use embassy::executor::Spawner; 6use embassy::executor::Spawner;
7use embassy_nrf::Peripherals; 7use embassy_nrf::{interrupt, qspi, Peripherals};
8use embassy_nrf::{interrupt, qspi}; 8use {defmt_rtt as _, panic_probe as _};
9
10use defmt_rtt as _; // global logger
11use panic_probe as _;
12 9
13const PAGE_SIZE: usize = 4096; 10const PAGE_SIZE: usize = 4096;
14 11
diff --git a/examples/nrf/src/bin/qspi_lowpower.rs b/examples/nrf/src/bin/qspi_lowpower.rs
index 255ce5d5e..ce2e40b23 100644
--- a/examples/nrf/src/bin/qspi_lowpower.rs
+++ b/examples/nrf/src/bin/qspi_lowpower.rs
@@ -3,14 +3,12 @@
3#![feature(type_alias_impl_trait)] 3#![feature(type_alias_impl_trait)]
4 4
5use core::mem; 5use core::mem;
6
6use defmt::{info, unwrap}; 7use defmt::{info, unwrap};
7use embassy::executor::Spawner; 8use embassy::executor::Spawner;
8use embassy::time::{Duration, Timer}; 9use embassy::time::{Duration, Timer};
9use embassy_nrf::Peripherals; 10use embassy_nrf::{interrupt, qspi, Peripherals};
10use embassy_nrf::{interrupt, qspi}; 11use {defmt_rtt as _, panic_probe as _};
11
12use defmt_rtt as _; // global logger
13use panic_probe as _;
14 12
15// Workaround for alignment requirements. 13// Workaround for alignment requirements.
16// Nicer API will probably come in the future. 14// Nicer API will probably come in the future.
diff --git a/examples/nrf/src/bin/raw_spawn.rs b/examples/nrf/src/bin/raw_spawn.rs
index 1d9d3ed51..d564b6b26 100644
--- a/examples/nrf/src/bin/raw_spawn.rs
+++ b/examples/nrf/src/bin/raw_spawn.rs
@@ -2,15 +2,14 @@
2#![no_main] 2#![no_main]
3 3
4use core::mem; 4use core::mem;
5
5use cortex_m_rt::entry; 6use cortex_m_rt::entry;
6use defmt::{info, unwrap}; 7use defmt::{info, unwrap};
7use embassy::executor::raw::TaskStorage; 8use embassy::executor::raw::TaskStorage;
8use embassy::executor::Executor; 9use embassy::executor::Executor;
9use embassy::time::{Duration, Timer}; 10use embassy::time::{Duration, Timer};
10use embassy::util::Forever; 11use embassy::util::Forever;
11 12use {defmt_rtt as _, panic_probe as _};
12use defmt_rtt as _; // global logger
13use panic_probe as _;
14 13
15async fn run1() { 14async fn run1() {
16 loop { 15 loop {
diff --git a/examples/nrf/src/bin/rng.rs b/examples/nrf/src/bin/rng.rs
index 4b4b3a19b..08d3abe10 100644
--- a/examples/nrf/src/bin/rng.rs
+++ b/examples/nrf/src/bin/rng.rs
@@ -3,13 +3,10 @@
3#![feature(type_alias_impl_trait)] 3#![feature(type_alias_impl_trait)]
4 4
5use embassy::executor::Spawner; 5use embassy::executor::Spawner;
6use embassy_nrf::interrupt;
7use embassy_nrf::rng::Rng; 6use embassy_nrf::rng::Rng;
8use embassy_nrf::Peripherals; 7use embassy_nrf::{interrupt, Peripherals};
9use rand::Rng as _; 8use rand::Rng as _;
10 9use {defmt_rtt as _, panic_probe as _};
11use defmt_rtt as _; // global logger
12use panic_probe as _;
13 10
14#[embassy::main] 11#[embassy::main]
15async fn main(_spawner: Spawner, p: Peripherals) { 12async fn main(_spawner: Spawner, p: Peripherals) {
@@ -27,12 +24,6 @@ async fn main(_spawner: Spawner, p: Peripherals) {
27 rng.fill_bytes(&mut bytes).await; 24 rng.fill_bytes(&mut bytes).await;
28 let zero_count: u32 = bytes.iter().fold(0, |acc, val| acc + val.count_zeros()); 25 let zero_count: u32 = bytes.iter().fold(0, |acc, val| acc + val.count_zeros());
29 let one_count: u32 = bytes.iter().fold(0, |acc, val| acc + val.count_ones()); 26 let one_count: u32 = bytes.iter().fold(0, |acc, val| acc + val.count_ones());
30 defmt::info!( 27 defmt::info!("Chance of zero: {}%", zero_count * 100 / (bytes.len() as u32 * 8));
31 "Chance of zero: {}%", 28 defmt::info!("Chance of one: {}%", one_count * 100 / (bytes.len() as u32 * 8));
32 zero_count * 100 / (bytes.len() as u32 * 8)
33 );
34 defmt::info!(
35 "Chance of one: {}%",
36 one_count * 100 / (bytes.len() as u32 * 8)
37 );
38} 29}
diff --git a/examples/nrf/src/bin/saadc.rs b/examples/nrf/src/bin/saadc.rs
index 5835be31f..cb9289784 100644
--- a/examples/nrf/src/bin/saadc.rs
+++ b/examples/nrf/src/bin/saadc.rs
@@ -7,9 +7,7 @@ use embassy::executor::Spawner;
7use embassy::time::{Duration, Timer}; 7use embassy::time::{Duration, Timer};
8use embassy_nrf::saadc::{ChannelConfig, Config, Saadc}; 8use embassy_nrf::saadc::{ChannelConfig, Config, Saadc};
9use embassy_nrf::{interrupt, Peripherals}; 9use embassy_nrf::{interrupt, Peripherals};
10 10use {defmt_rtt as _, panic_probe as _};
11use defmt_rtt as _; // global logger
12use panic_probe as _;
13 11
14#[embassy::main] 12#[embassy::main]
15async fn main(_spawner: Spawner, mut p: Peripherals) { 13async fn main(_spawner: Spawner, mut p: Peripherals) {
diff --git a/examples/nrf/src/bin/saadc_continuous.rs b/examples/nrf/src/bin/saadc_continuous.rs
index 5e357f79b..234294eae 100644
--- a/examples/nrf/src/bin/saadc_continuous.rs
+++ b/examples/nrf/src/bin/saadc_continuous.rs
@@ -8,9 +8,7 @@ use embassy::time::Duration;
8use embassy_nrf::saadc::{ChannelConfig, Config, Saadc, SamplerState}; 8use embassy_nrf::saadc::{ChannelConfig, Config, Saadc, SamplerState};
9use embassy_nrf::timer::Frequency; 9use embassy_nrf::timer::Frequency;
10use embassy_nrf::{interrupt, Peripherals}; 10use embassy_nrf::{interrupt, Peripherals};
11 11use {defmt_rtt as _, panic_probe as _};
12use defmt_rtt as _; // global logger
13use panic_probe as _;
14 12
15// Demonstrates both continuous sampling and scanning multiple channels driven by a PPI linked timer 13// Demonstrates both continuous sampling and scanning multiple channels driven by a PPI linked timer
16 14
diff --git a/examples/nrf/src/bin/self_spawn.rs b/examples/nrf/src/bin/self_spawn.rs
index 35e73a8dd..4b8ac04bc 100644
--- a/examples/nrf/src/bin/self_spawn.rs
+++ b/examples/nrf/src/bin/self_spawn.rs
@@ -6,9 +6,7 @@ use defmt::{info, unwrap};
6use embassy::executor::Spawner; 6use embassy::executor::Spawner;
7use embassy::time::{Duration, Timer}; 7use embassy::time::{Duration, Timer};
8use embassy_nrf::Peripherals; 8use embassy_nrf::Peripherals;
9 9use {defmt_rtt as _, panic_probe as _};
10use defmt_rtt as _; // global logger
11use panic_probe as _;
12 10
13#[embassy::task(pool_size = 2)] 11#[embassy::task(pool_size = 2)]
14async fn my_task(spawner: Spawner, n: u32) { 12async fn my_task(spawner: Spawner, n: u32) {
diff --git a/examples/nrf/src/bin/self_spawn_current_executor.rs b/examples/nrf/src/bin/self_spawn_current_executor.rs
index 4850d295d..3c3379ce6 100644
--- a/examples/nrf/src/bin/self_spawn_current_executor.rs
+++ b/examples/nrf/src/bin/self_spawn_current_executor.rs
@@ -6,9 +6,7 @@ use defmt::{info, unwrap};
6use embassy::executor::Spawner; 6use embassy::executor::Spawner;
7use embassy::time::{Duration, Timer}; 7use embassy::time::{Duration, Timer};
8use embassy_nrf::Peripherals; 8use embassy_nrf::Peripherals;
9 9use {defmt_rtt as _, panic_probe as _};
10use defmt_rtt as _; // global logger
11use panic_probe as _;
12 10
13#[embassy::task(pool_size = 2)] 11#[embassy::task(pool_size = 2)]
14async fn my_task(n: u32) { 12async fn my_task(n: u32) {
diff --git a/examples/nrf/src/bin/spim.rs b/examples/nrf/src/bin/spim.rs
index f2a4ab388..62040168a 100644
--- a/examples/nrf/src/bin/spim.rs
+++ b/examples/nrf/src/bin/spim.rs
@@ -5,11 +5,8 @@
5use defmt::{info, unwrap}; 5use defmt::{info, unwrap};
6use embassy::executor::Spawner; 6use embassy::executor::Spawner;
7use embassy_nrf::gpio::{Level, Output, OutputDrive}; 7use embassy_nrf::gpio::{Level, Output, OutputDrive};
8use embassy_nrf::Peripherals; 8use embassy_nrf::{interrupt, spim, Peripherals};
9use embassy_nrf::{interrupt, spim}; 9use {defmt_rtt as _, panic_probe as _};
10
11use defmt_rtt as _; // global logger
12use panic_probe as _;
13 10
14#[embassy::main] 11#[embassy::main]
15async fn main(_spawner: Spawner, p: Peripherals) { 12async fn main(_spawner: Spawner, p: Peripherals) {
diff --git a/examples/nrf/src/bin/temp.rs b/examples/nrf/src/bin/temp.rs
index aa807910f..939cb39e7 100644
--- a/examples/nrf/src/bin/temp.rs
+++ b/examples/nrf/src/bin/temp.rs
@@ -5,10 +5,9 @@
5use defmt::info; 5use defmt::info;
6use embassy::executor::Spawner; 6use embassy::executor::Spawner;
7use embassy::time::{Duration, Timer}; 7use embassy::time::{Duration, Timer};
8use embassy_nrf::{interrupt, temp::Temp, Peripherals}; 8use embassy_nrf::temp::Temp;
9 9use embassy_nrf::{interrupt, Peripherals};
10use defmt_rtt as _; // global logger 10use {defmt_rtt as _, panic_probe as _};
11use panic_probe as _;
12 11
13#[embassy::main] 12#[embassy::main]
14async fn main(_spawner: Spawner, p: Peripherals) { 13async fn main(_spawner: Spawner, p: Peripherals) {
diff --git a/examples/nrf/src/bin/timer.rs b/examples/nrf/src/bin/timer.rs
index ff8ee9a86..64376dd78 100644
--- a/examples/nrf/src/bin/timer.rs
+++ b/examples/nrf/src/bin/timer.rs
@@ -6,9 +6,7 @@ use defmt::{info, unwrap};
6use embassy::executor::Spawner; 6use embassy::executor::Spawner;
7use embassy::time::{Duration, Timer}; 7use embassy::time::{Duration, Timer};
8use embassy_nrf::Peripherals; 8use embassy_nrf::Peripherals;
9 9use {defmt_rtt as _, panic_probe as _};
10use defmt_rtt as _; // global logger
11use panic_probe as _;
12 10
13#[embassy::task] 11#[embassy::task]
14async fn run1() { 12async fn run1() {
diff --git a/examples/nrf/src/bin/twim.rs b/examples/nrf/src/bin/twim.rs
index 08c614157..fb8372a12 100644
--- a/examples/nrf/src/bin/twim.rs
+++ b/examples/nrf/src/bin/twim.rs
@@ -10,9 +10,7 @@ use defmt::*;
10use embassy::executor::Spawner; 10use embassy::executor::Spawner;
11use embassy_nrf::twim::{self, Twim}; 11use embassy_nrf::twim::{self, Twim};
12use embassy_nrf::{interrupt, Peripherals}; 12use embassy_nrf::{interrupt, Peripherals};
13 13use {defmt_rtt as _, panic_probe as _};
14use defmt_rtt as _; // global logger
15use panic_probe as _;
16 14
17const ADDRESS: u8 = 0x50; 15const ADDRESS: u8 = 0x50;
18 16
diff --git a/examples/nrf/src/bin/twim_lowpower.rs b/examples/nrf/src/bin/twim_lowpower.rs
index 45b347ea0..c9c2d503e 100644
--- a/examples/nrf/src/bin/twim_lowpower.rs
+++ b/examples/nrf/src/bin/twim_lowpower.rs
@@ -9,14 +9,13 @@
9#![feature(type_alias_impl_trait)] 9#![feature(type_alias_impl_trait)]
10 10
11use core::mem; 11use core::mem;
12
12use defmt::*; 13use defmt::*;
13use embassy::executor::Spawner; 14use embassy::executor::Spawner;
14use embassy::time::{Duration, Timer}; 15use embassy::time::{Duration, Timer};
15use embassy_nrf::twim::{self, Twim}; 16use embassy_nrf::twim::{self, Twim};
16use embassy_nrf::{interrupt, Peripherals}; 17use embassy_nrf::{interrupt, Peripherals};
17 18use {defmt_rtt as _, panic_probe as _};
18use defmt_rtt as _; // global logger
19use panic_probe as _;
20 19
21const ADDRESS: u8 = 0x50; 20const ADDRESS: u8 = 0x50;
22 21
diff --git a/examples/nrf/src/bin/uart.rs b/examples/nrf/src/bin/uart.rs
index 91f7f4fdd..c8c4a67a5 100644
--- a/examples/nrf/src/bin/uart.rs
+++ b/examples/nrf/src/bin/uart.rs
@@ -5,9 +5,7 @@
5use defmt::*; 5use defmt::*;
6use embassy::executor::Spawner; 6use embassy::executor::Spawner;
7use embassy_nrf::{interrupt, uarte, Peripherals}; 7use embassy_nrf::{interrupt, uarte, Peripherals};
8 8use {defmt_rtt as _, panic_probe as _};
9use defmt_rtt as _; // global logger
10use panic_probe as _;
11 9
12#[embassy::main] 10#[embassy::main]
13async fn main(_spawner: Spawner, p: Peripherals) { 11async fn main(_spawner: Spawner, p: Peripherals) {
diff --git a/examples/nrf/src/bin/uart_idle.rs b/examples/nrf/src/bin/uart_idle.rs
index 89336faaf..6679b28da 100644
--- a/examples/nrf/src/bin/uart_idle.rs
+++ b/examples/nrf/src/bin/uart_idle.rs
@@ -5,9 +5,7 @@
5use defmt::*; 5use defmt::*;
6use embassy::executor::Spawner; 6use embassy::executor::Spawner;
7use embassy_nrf::{interrupt, uarte, Peripherals}; 7use embassy_nrf::{interrupt, uarte, Peripherals};
8 8use {defmt_rtt as _, panic_probe as _};
9use defmt_rtt as _; // global logger
10use panic_probe as _;
11 9
12#[embassy::main] 10#[embassy::main]
13async fn main(_spawner: Spawner, p: Peripherals) { 11async fn main(_spawner: Spawner, p: Peripherals) {
@@ -16,9 +14,7 @@ async fn main(_spawner: Spawner, p: Peripherals) {
16 config.baudrate = uarte::Baudrate::BAUD115200; 14 config.baudrate = uarte::Baudrate::BAUD115200;
17 15
18 let irq = interrupt::take!(UARTE0_UART0); 16 let irq = interrupt::take!(UARTE0_UART0);
19 let mut uart = uarte::UarteWithIdle::new( 17 let mut uart = uarte::UarteWithIdle::new(p.UARTE0, p.TIMER0, p.PPI_CH0, p.PPI_CH1, irq, p.P0_08, p.P0_06, config);
20 p.UARTE0, p.TIMER0, p.PPI_CH0, p.PPI_CH1, irq, p.P0_08, p.P0_06, config,
21 );
22 18
23 info!("uarte initialized!"); 19 info!("uarte initialized!");
24 20
diff --git a/examples/nrf/src/bin/uart_split.rs b/examples/nrf/src/bin/uart_split.rs
index 958cfeba0..1ffb63706 100644
--- a/examples/nrf/src/bin/uart_split.rs
+++ b/examples/nrf/src/bin/uart_split.rs
@@ -9,9 +9,7 @@ use embassy::executor::Spawner;
9use embassy_nrf::peripherals::UARTE0; 9use embassy_nrf::peripherals::UARTE0;
10use embassy_nrf::uarte::UarteRx; 10use embassy_nrf::uarte::UarteRx;
11use embassy_nrf::{interrupt, uarte, Peripherals}; 11use embassy_nrf::{interrupt, uarte, Peripherals};
12 12use {defmt_rtt as _, panic_probe as _};
13use defmt_rtt as _; // global logger
14use panic_probe as _;
15 13
16static CHANNEL: Channel<ThreadModeRawMutex, [u8; 8], 1> = Channel::new(); 14static CHANNEL: Channel<ThreadModeRawMutex, [u8; 8], 1> = Channel::new();
17 15
diff --git a/examples/nrf/src/bin/usb_ethernet.rs b/examples/nrf/src/bin/usb_ethernet.rs
index 3d85d22bb..a20321fe8 100644
--- a/examples/nrf/src/bin/usb_ethernet.rs
+++ b/examples/nrf/src/bin/usb_ethernet.rs
@@ -6,6 +6,7 @@
6use core::mem; 6use core::mem;
7use core::sync::atomic::{AtomicBool, Ordering}; 7use core::sync::atomic::{AtomicBool, Ordering};
8use core::task::Waker; 8use core::task::Waker;
9
9use defmt::*; 10use defmt::*;
10use embassy::blocking_mutex::raw::ThreadModeRawMutex; 11use embassy::blocking_mutex::raw::ThreadModeRawMutex;
11use embassy::channel::mpmc::Channel; 12use embassy::channel::mpmc::Channel;
@@ -13,18 +14,13 @@ use embassy::executor::Spawner;
13use embassy::util::Forever; 14use embassy::util::Forever;
14use embassy_net::tcp::TcpSocket; 15use embassy_net::tcp::TcpSocket;
15use embassy_net::{PacketBox, PacketBoxExt, PacketBuf, Stack, StackResources}; 16use embassy_net::{PacketBox, PacketBoxExt, PacketBuf, Stack, StackResources};
16use embassy_nrf::pac;
17use embassy_nrf::rng::Rng; 17use embassy_nrf::rng::Rng;
18use embassy_nrf::usb::Driver; 18use embassy_nrf::usb::Driver;
19use embassy_nrf::Peripherals; 19use embassy_nrf::{interrupt, pac, peripherals, Peripherals};
20use embassy_nrf::{interrupt, peripherals};
21use embassy_usb::{Builder, Config, UsbDevice}; 20use embassy_usb::{Builder, Config, UsbDevice};
22use embassy_usb_ncm::{CdcNcmClass, Receiver, Sender, State}; 21use embassy_usb_ncm::{CdcNcmClass, Receiver, Sender, State};
23
24use defmt_rtt as _;
25use embedded_io::asynch::{Read, Write}; 22use embedded_io::asynch::{Read, Write};
26// global logger 23use {defmt_rtt as _, panic_probe as _};
27use panic_probe as _;
28 24
29type MyDriver = Driver<'static, peripherals::USBD>; 25type MyDriver = Driver<'static, peripherals::USBD>;
30 26
@@ -180,9 +176,7 @@ async fn main(spawner: Spawner, p: Peripherals) {
180 let seed = u64::from_le_bytes(seed); 176 let seed = u64::from_le_bytes(seed);
181 177
182 // Init network stack 178 // Init network stack
183 let device = Device { 179 let device = Device { mac_addr: our_mac_addr };
184 mac_addr: our_mac_addr,
185 };
186 let stack = &*forever!(Stack::new( 180 let stack = &*forever!(Stack::new(
187 device, 181 device,
188 config, 182 config,
diff --git a/examples/nrf/src/bin/usb_hid_keyboard.rs b/examples/nrf/src/bin/usb_hid_keyboard.rs
index 98e7dd696..97ec861d8 100644
--- a/examples/nrf/src/bin/usb_hid_keyboard.rs
+++ b/examples/nrf/src/bin/usb_hid_keyboard.rs
@@ -5,25 +5,22 @@
5 5
6use core::mem; 6use core::mem;
7use core::sync::atomic::{AtomicBool, Ordering}; 7use core::sync::atomic::{AtomicBool, Ordering};
8
8use defmt::*; 9use defmt::*;
9use embassy::channel::signal::Signal; 10use embassy::channel::signal::Signal;
10use embassy::executor::Spawner; 11use embassy::executor::Spawner;
11use embassy::time::Duration; 12use embassy::time::Duration;
12use embassy::util::{select, select3, Either, Either3}; 13use embassy::util::{select, select3, Either, Either3};
13use embassy_nrf::gpio::{Input, Pin, Pull}; 14use embassy_nrf::gpio::{Input, Pin, Pull};
14use embassy_nrf::interrupt;
15use embassy_nrf::interrupt::InterruptExt; 15use embassy_nrf::interrupt::InterruptExt;
16use embassy_nrf::pac;
17use embassy_nrf::usb::Driver; 16use embassy_nrf::usb::Driver;
18use embassy_nrf::Peripherals; 17use embassy_nrf::{interrupt, pac, Peripherals};
19use embassy_usb::control::OutResponse; 18use embassy_usb::control::OutResponse;
20use embassy_usb::{Builder, Config, DeviceStateHandler}; 19use embassy_usb::{Builder, Config, DeviceStateHandler};
21use embassy_usb_hid::{HidReaderWriter, ReportId, RequestHandler, State}; 20use embassy_usb_hid::{HidReaderWriter, ReportId, RequestHandler, State};
22use futures::future::join; 21use futures::future::join;
23use usbd_hid::descriptor::{KeyboardReport, SerializedDescriptor}; 22use usbd_hid::descriptor::{KeyboardReport, SerializedDescriptor};
24 23use {defmt_rtt as _, panic_probe as _};
25use defmt_rtt as _; // global logger
26use panic_probe as _;
27 24
28static ENABLE_USB: Signal<bool> = Signal::new(); 25static ENABLE_USB: Signal<bool> = Signal::new();
29static SUSPENDED: AtomicBool = AtomicBool::new(false); 26static SUSPENDED: AtomicBool = AtomicBool::new(false);
@@ -182,9 +179,7 @@ async fn main(_spawner: Spawner, p: Peripherals) {
182 power_irq.unpend(); 179 power_irq.unpend();
183 power_irq.enable(); 180 power_irq.enable();
184 181
185 power 182 power.intenset.write(|w| w.usbdetected().set().usbremoved().set());
186 .intenset
187 .write(|w| w.usbdetected().set().usbremoved().set());
188 183
189 // Run everything concurrently. 184 // Run everything concurrently.
190 // If we had made everything `'static` above instead, we could do this using separate tasks instead. 185 // If we had made everything `'static` above instead, we could do this using separate tasks instead.
@@ -260,9 +255,7 @@ impl DeviceStateHandler for MyDeviceStateHandler {
260 fn configured(&self, configured: bool) { 255 fn configured(&self, configured: bool) {
261 self.configured.store(configured, Ordering::Relaxed); 256 self.configured.store(configured, Ordering::Relaxed);
262 if configured { 257 if configured {
263 info!( 258 info!("Device configured, it may now draw up to the configured current limit from Vbus.")
264 "Device configured, it may now draw up to the configured current limit from Vbus."
265 )
266 } else { 259 } else {
267 info!("Device is no longer configured, the Vbus current limit is 100mA."); 260 info!("Device is no longer configured, the Vbus current limit is 100mA.");
268 } 261 }
@@ -275,9 +268,7 @@ impl DeviceStateHandler for MyDeviceStateHandler {
275 } else { 268 } else {
276 SUSPENDED.store(false, Ordering::Release); 269 SUSPENDED.store(false, Ordering::Release);
277 if self.configured.load(Ordering::Relaxed) { 270 if self.configured.load(Ordering::Relaxed) {
278 info!( 271 info!("Device resumed, it may now draw up to the configured current limit from Vbus");
279 "Device resumed, it may now draw up to the configured current limit from Vbus"
280 );
281 } else { 272 } else {
282 info!("Device resumed, the Vbus current limit is 100mA"); 273 info!("Device resumed, the Vbus current limit is 100mA");
283 } 274 }
diff --git a/examples/nrf/src/bin/usb_hid_mouse.rs b/examples/nrf/src/bin/usb_hid_mouse.rs
index c526c1c6f..9c44e5cc8 100644
--- a/examples/nrf/src/bin/usb_hid_mouse.rs
+++ b/examples/nrf/src/bin/usb_hid_mouse.rs
@@ -4,21 +4,18 @@
4#![feature(type_alias_impl_trait)] 4#![feature(type_alias_impl_trait)]
5 5
6use core::mem; 6use core::mem;
7
7use defmt::*; 8use defmt::*;
8use embassy::executor::Spawner; 9use embassy::executor::Spawner;
9use embassy::time::{Duration, Timer}; 10use embassy::time::{Duration, Timer};
10use embassy_nrf::interrupt;
11use embassy_nrf::pac;
12use embassy_nrf::usb::Driver; 11use embassy_nrf::usb::Driver;
13use embassy_nrf::Peripherals; 12use embassy_nrf::{interrupt, pac, Peripherals};
14use embassy_usb::control::OutResponse; 13use embassy_usb::control::OutResponse;
15use embassy_usb::{Builder, Config}; 14use embassy_usb::{Builder, Config};
16use embassy_usb_hid::{HidWriter, ReportId, RequestHandler, State}; 15use embassy_usb_hid::{HidWriter, ReportId, RequestHandler, State};
17use futures::future::join; 16use futures::future::join;
18use usbd_hid::descriptor::{MouseReport, SerializedDescriptor}; 17use usbd_hid::descriptor::{MouseReport, SerializedDescriptor};
19 18use {defmt_rtt as _, panic_probe as _};
20use defmt_rtt as _; // global logger
21use panic_probe as _;
22 19
23#[embassy::main] 20#[embassy::main]
24async fn main(_spawner: Spawner, p: Peripherals) { 21async fn main(_spawner: Spawner, p: Peripherals) {
diff --git a/examples/nrf/src/bin/usb_serial.rs b/examples/nrf/src/bin/usb_serial.rs
index 2551c4ba1..f108db46d 100644
--- a/examples/nrf/src/bin/usb_serial.rs
+++ b/examples/nrf/src/bin/usb_serial.rs
@@ -4,19 +4,16 @@
4#![feature(type_alias_impl_trait)] 4#![feature(type_alias_impl_trait)]
5 5
6use core::mem; 6use core::mem;
7
7use defmt::{info, panic}; 8use defmt::{info, panic};
8use embassy::executor::Spawner; 9use embassy::executor::Spawner;
9use embassy_nrf::interrupt;
10use embassy_nrf::pac;
11use embassy_nrf::usb::{Driver, Instance}; 10use embassy_nrf::usb::{Driver, Instance};
12use embassy_nrf::Peripherals; 11use embassy_nrf::{interrupt, pac, Peripherals};
13use embassy_usb::driver::EndpointError; 12use embassy_usb::driver::EndpointError;
14use embassy_usb::{Builder, Config}; 13use embassy_usb::{Builder, Config};
15use embassy_usb_serial::{CdcAcmClass, State}; 14use embassy_usb_serial::{CdcAcmClass, State};
16use futures::future::join; 15use futures::future::join;
17 16use {defmt_rtt as _, panic_probe as _};
18use defmt_rtt as _; // global logger
19use panic_probe as _;
20 17
21#[embassy::main] 18#[embassy::main]
22async fn main(_spawner: Spawner, p: Peripherals) { 19async fn main(_spawner: Spawner, p: Peripherals) {
@@ -104,9 +101,7 @@ impl From<EndpointError> for Disconnected {
104 } 101 }
105} 102}
106 103
107async fn echo<'d, T: Instance + 'd>( 104async fn echo<'d, T: Instance + 'd>(class: &mut CdcAcmClass<'d, Driver<'d, T>>) -> Result<(), Disconnected> {
108 class: &mut CdcAcmClass<'d, Driver<'d, T>>,
109) -> Result<(), Disconnected> {
110 let mut buf = [0; 64]; 105 let mut buf = [0; 64];
111 loop { 106 loop {
112 let n = class.read_packet(&mut buf).await?; 107 let n = class.read_packet(&mut buf).await?;
diff --git a/examples/nrf/src/bin/usb_serial_multitask.rs b/examples/nrf/src/bin/usb_serial_multitask.rs
index 0e82ba313..dc503e67c 100644
--- a/examples/nrf/src/bin/usb_serial_multitask.rs
+++ b/examples/nrf/src/bin/usb_serial_multitask.rs
@@ -4,19 +4,16 @@
4#![feature(type_alias_impl_trait)] 4#![feature(type_alias_impl_trait)]
5 5
6use core::mem; 6use core::mem;
7
7use defmt::{info, panic, unwrap}; 8use defmt::{info, panic, unwrap};
8use embassy::executor::Spawner; 9use embassy::executor::Spawner;
9use embassy::util::Forever; 10use embassy::util::Forever;
10use embassy_nrf::pac;
11use embassy_nrf::usb::Driver; 11use embassy_nrf::usb::Driver;
12use embassy_nrf::Peripherals; 12use embassy_nrf::{interrupt, pac, peripherals, Peripherals};
13use embassy_nrf::{interrupt, peripherals};
14use embassy_usb::driver::EndpointError; 13use embassy_usb::driver::EndpointError;
15use embassy_usb::{Builder, Config, UsbDevice}; 14use embassy_usb::{Builder, Config, UsbDevice};
16use embassy_usb_serial::{CdcAcmClass, State}; 15use embassy_usb_serial::{CdcAcmClass, State};
17 16use {defmt_rtt as _, panic_probe as _};
18use defmt_rtt as _; // global logger
19use panic_probe as _;
20 17
21type MyDriver = Driver<'static, peripherals::USBD>; 18type MyDriver = Driver<'static, peripherals::USBD>;
22 19
diff --git a/examples/nrf/src/bin/wdt.rs b/examples/nrf/src/bin/wdt.rs
index 431ccca8b..280e23bcf 100644
--- a/examples/nrf/src/bin/wdt.rs
+++ b/examples/nrf/src/bin/wdt.rs
@@ -7,9 +7,7 @@ use embassy::executor::Spawner;
7use embassy_nrf::gpio::{Input, Pull}; 7use embassy_nrf::gpio::{Input, Pull};
8use embassy_nrf::wdt::{Config, Watchdog}; 8use embassy_nrf::wdt::{Config, Watchdog};
9use embassy_nrf::Peripherals; 9use embassy_nrf::Peripherals;
10 10use {defmt_rtt as _, panic_probe as _};
11use defmt_rtt as _; // global logger
12use panic_probe as _;
13 11
14#[embassy::main] 12#[embassy::main]
15async fn main(_spawner: Spawner, p: Peripherals) { 13async fn main(_spawner: Spawner, p: Peripherals) {