aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/nrf/Cargo.toml6
-rw-r--r--tests/nrf/src/bin/ethernet_enc28j60_perf.rs11
-rw-r--r--tests/nrf/src/bin/wifi_esp_hosted_perf.rs14
-rw-r--r--tests/rp/Cargo.toml8
-rw-r--r--tests/rp/src/bin/cyw43-perf.rs14
-rw-r--r--tests/rp/src/bin/ethernet_w5100s_perf.rs14
-rw-r--r--tests/rp/src/bin/gpio.rs10
-rw-r--r--tests/rp/src/bin/pwm.rs8
-rw-r--r--tests/stm32/Cargo.toml6
-rw-r--r--tests/stm32/src/bin/eth.rs14
-rw-r--r--tests/stm32/src/bin/gpio.rs12
-rw-r--r--tests/stm32/src/bin/stop.rs6
12 files changed, 66 insertions, 57 deletions
diff --git a/tests/nrf/Cargo.toml b/tests/nrf/Cargo.toml
index 7b0d59ee2..ccdca0844 100644
--- a/tests/nrf/Cargo.toml
+++ b/tests/nrf/Cargo.toml
@@ -16,9 +16,9 @@ embedded-io-async = { version = "0.6.1", features = ["defmt-03"] }
16embassy-net = { version = "0.2.0", path = "../../embassy-net", features = ["defmt", "tcp", "dhcpv4", "medium-ethernet", ] } 16embassy-net = { version = "0.2.0", path = "../../embassy-net", features = ["defmt", "tcp", "dhcpv4", "medium-ethernet", ] }
17embassy-net-esp-hosted = { version = "0.1.0", path = "../../embassy-net-esp-hosted", features = ["defmt"] } 17embassy-net-esp-hosted = { version = "0.1.0", path = "../../embassy-net-esp-hosted", features = ["defmt"] }
18embassy-net-enc28j60 = { version = "0.1.0", path = "../../embassy-net-enc28j60", features = ["defmt"] } 18embassy-net-enc28j60 = { version = "0.1.0", path = "../../embassy-net-enc28j60", features = ["defmt"] }
19embedded-hal-async = { version = "1.0.0-rc.2" } 19embedded-hal-async = { version = "1.0.0-rc.3" }
20embedded-hal-bus = { version = "0.1.0-rc.2", features = ["async"] } 20embedded-hal-bus = { version = "0.1.0-rc.3", features = ["async"] }
21static_cell = { version = "2", features = [ "nightly" ] } 21static_cell = "2"
22perf-client = { path = "../perf-client" } 22perf-client = { path = "../perf-client" }
23 23
24defmt = "0.3" 24defmt = "0.3"
diff --git a/tests/nrf/src/bin/ethernet_enc28j60_perf.rs b/tests/nrf/src/bin/ethernet_enc28j60_perf.rs
index 60d30a2ff..7dc1941d7 100644
--- a/tests/nrf/src/bin/ethernet_enc28j60_perf.rs
+++ b/tests/nrf/src/bin/ethernet_enc28j60_perf.rs
@@ -1,6 +1,5 @@
1#![no_std] 1#![no_std]
2#![no_main] 2#![no_main]
3#![feature(type_alias_impl_trait)]
4teleprobe_meta::target!(b"ak-gwe-r7"); 3teleprobe_meta::target!(b"ak-gwe-r7");
5teleprobe_meta::timeout!(120); 4teleprobe_meta::timeout!(120);
6 5
@@ -14,7 +13,7 @@ use embassy_nrf::spim::{self, Spim};
14use embassy_nrf::{bind_interrupts, peripherals}; 13use embassy_nrf::{bind_interrupts, peripherals};
15use embassy_time::Delay; 14use embassy_time::Delay;
16use embedded_hal_bus::spi::ExclusiveDevice; 15use embedded_hal_bus::spi::ExclusiveDevice;
17use static_cell::make_static; 16use static_cell::StaticCell;
18use {defmt_rtt as _, panic_probe as _}; 17use {defmt_rtt as _, panic_probe as _};
19 18
20bind_interrupts!(struct Irqs { 19bind_interrupts!(struct Irqs {
@@ -68,11 +67,13 @@ async fn main(spawner: Spawner) {
68 let seed = u64::from_le_bytes(seed); 67 let seed = u64::from_le_bytes(seed);
69 68
70 // Init network stack 69 // Init network stack
71 let stack = &*make_static!(Stack::new( 70 static STACK: StaticCell<Stack<MyDriver>> = StaticCell::new();
71 static RESOURCES: StaticCell<StackResources<2>> = StaticCell::new();
72 let stack = &*STACK.init(Stack::new(
72 device, 73 device,
73 config, 74 config,
74 make_static!(StackResources::<2>::new()), 75 RESOURCES.init(StackResources::<2>::new()),
75 seed 76 seed,
76 )); 77 ));
77 78
78 unwrap!(spawner.spawn(net_task(stack))); 79 unwrap!(spawner.spawn(net_task(stack)));
diff --git a/tests/nrf/src/bin/wifi_esp_hosted_perf.rs b/tests/nrf/src/bin/wifi_esp_hosted_perf.rs
index 9eee39ccf..c96064f84 100644
--- a/tests/nrf/src/bin/wifi_esp_hosted_perf.rs
+++ b/tests/nrf/src/bin/wifi_esp_hosted_perf.rs
@@ -1,6 +1,5 @@
1#![no_std] 1#![no_std]
2#![no_main] 2#![no_main]
3#![feature(type_alias_impl_trait)]
4teleprobe_meta::target!(b"nrf52840-dk"); 3teleprobe_meta::target!(b"nrf52840-dk");
5teleprobe_meta::timeout!(120); 4teleprobe_meta::timeout!(120);
6 5
@@ -13,7 +12,7 @@ use embassy_nrf::spim::{self, Spim};
13use embassy_nrf::{bind_interrupts, peripherals}; 12use embassy_nrf::{bind_interrupts, peripherals};
14use embassy_time::Delay; 13use embassy_time::Delay;
15use embedded_hal_bus::spi::ExclusiveDevice; 14use embedded_hal_bus::spi::ExclusiveDevice;
16use static_cell::make_static; 15use static_cell::StaticCell;
17use {defmt_rtt as _, embassy_net_esp_hosted as hosted, panic_probe as _}; 16use {defmt_rtt as _, embassy_net_esp_hosted as hosted, panic_probe as _};
18 17
19bind_interrupts!(struct Irqs { 18bind_interrupts!(struct Irqs {
@@ -64,8 +63,9 @@ async fn main(spawner: Spawner) {
64 let spi = spim::Spim::new(p.SPI3, Irqs, sck, miso, mosi, config); 63 let spi = spim::Spim::new(p.SPI3, Irqs, sck, miso, mosi, config);
65 let spi = ExclusiveDevice::new(spi, cs, Delay); 64 let spi = ExclusiveDevice::new(spi, cs, Delay);
66 65
66 static STATE: StaticCell<embassy_net_esp_hosted::State> = StaticCell::new();
67 let (device, mut control, runner) = embassy_net_esp_hosted::new( 67 let (device, mut control, runner) = embassy_net_esp_hosted::new(
68 make_static!(embassy_net_esp_hosted::State::new()), 68 STATE.init(embassy_net_esp_hosted::State::new()),
69 spi, 69 spi,
70 handshake, 70 handshake,
71 ready, 71 ready,
@@ -85,11 +85,13 @@ async fn main(spawner: Spawner) {
85 let seed = u64::from_le_bytes(seed); 85 let seed = u64::from_le_bytes(seed);
86 86
87 // Init network stack 87 // Init network stack
88 let stack = &*make_static!(Stack::new( 88 static STACK: StaticCell<Stack<MyDriver>> = StaticCell::new();
89 static RESOURCES: StaticCell<StackResources<2>> = StaticCell::new();
90 let stack = &*STACK.init(Stack::new(
89 device, 91 device,
90 Config::dhcpv4(Default::default()), 92 Config::dhcpv4(Default::default()),
91 make_static!(StackResources::<2>::new()), 93 RESOURCES.init(StackResources::<2>::new()),
92 seed 94 seed,
93 )); 95 ));
94 96
95 unwrap!(spawner.spawn(net_task(stack))); 97 unwrap!(spawner.spawn(net_task(stack)));
diff --git a/tests/rp/Cargo.toml b/tests/rp/Cargo.toml
index 44fb7bed6..c38aa8004 100644
--- a/tests/rp/Cargo.toml
+++ b/tests/rp/Cargo.toml
@@ -24,14 +24,14 @@ defmt-rtt = "0.4"
24cortex-m = { version = "0.7.6" } 24cortex-m = { version = "0.7.6" }
25cortex-m-rt = "0.7.0" 25cortex-m-rt = "0.7.0"
26embedded-hal = "0.2.6" 26embedded-hal = "0.2.6"
27embedded-hal-1 = { package = "embedded-hal", version = "=1.0.0-rc.2" } 27embedded-hal-1 = { package = "embedded-hal", version = "=1.0.0-rc.3" }
28embedded-hal-async = { version = "=1.0.0-rc.2" } 28embedded-hal-async = { version = "=1.0.0-rc.3" }
29embedded-hal-bus = { version = "=0.1.0-rc.2", features = ["async"] } 29embedded-hal-bus = { version = "=0.1.0-rc.3", features = ["async"] }
30panic-probe = { version = "0.3.0", features = ["print-defmt"] } 30panic-probe = { version = "0.3.0", features = ["print-defmt"] }
31futures = { version = "0.3.17", default-features = false, features = ["async-await"] } 31futures = { version = "0.3.17", default-features = false, features = ["async-await"] }
32embedded-io-async = { version = "0.6.1" } 32embedded-io-async = { version = "0.6.1" }
33embedded-storage = { version = "0.3" } 33embedded-storage = { version = "0.3" }
34static_cell = { version = "2", features = ["nightly"]} 34static_cell = "2"
35portable-atomic = { version = "1.5", features = ["critical-section"] } 35portable-atomic = { version = "1.5", features = ["critical-section"] }
36pio = "0.2" 36pio = "0.2"
37pio-proc = "0.2" 37pio-proc = "0.2"
diff --git a/tests/rp/src/bin/cyw43-perf.rs b/tests/rp/src/bin/cyw43-perf.rs
index de29c06dd..a1b2946e6 100644
--- a/tests/rp/src/bin/cyw43-perf.rs
+++ b/tests/rp/src/bin/cyw43-perf.rs
@@ -1,6 +1,5 @@
1#![no_std] 1#![no_std]
2#![no_main] 2#![no_main]
3#![feature(type_alias_impl_trait)]
4teleprobe_meta::target!(b"rpi-pico"); 3teleprobe_meta::target!(b"rpi-pico");
5 4
6use cyw43_pio::PioSpi; 5use cyw43_pio::PioSpi;
@@ -11,7 +10,7 @@ use embassy_rp::gpio::{Level, Output};
11use embassy_rp::peripherals::{DMA_CH0, PIN_23, PIN_25, PIO0}; 10use embassy_rp::peripherals::{DMA_CH0, PIN_23, PIN_25, PIO0};
12use embassy_rp::pio::{InterruptHandler, Pio}; 11use embassy_rp::pio::{InterruptHandler, Pio};
13use embassy_rp::{bind_interrupts, rom_data}; 12use embassy_rp::{bind_interrupts, rom_data};
14use static_cell::make_static; 13use static_cell::StaticCell;
15use {defmt_rtt as _, panic_probe as _}; 14use {defmt_rtt as _, panic_probe as _};
16 15
17bind_interrupts!(struct Irqs { 16bind_interrupts!(struct Irqs {
@@ -58,7 +57,8 @@ async fn main(spawner: Spawner) {
58 let mut pio = Pio::new(p.PIO0, Irqs); 57 let mut pio = Pio::new(p.PIO0, Irqs);
59 let spi = PioSpi::new(&mut pio.common, pio.sm0, pio.irq0, cs, p.PIN_24, p.PIN_29, p.DMA_CH0); 58 let spi = PioSpi::new(&mut pio.common, pio.sm0, pio.irq0, cs, p.PIN_24, p.PIN_29, p.DMA_CH0);
60 59
61 let state = make_static!(cyw43::State::new()); 60 static STATE: StaticCell<cyw43::State> = StaticCell::new();
61 let state = STATE.init(cyw43::State::new());
62 let (net_device, mut control, runner) = cyw43::new(state, pwr, spi, fw).await; 62 let (net_device, mut control, runner) = cyw43::new(state, pwr, spi, fw).await;
63 unwrap!(spawner.spawn(wifi_task(runner))); 63 unwrap!(spawner.spawn(wifi_task(runner)));
64 64
@@ -71,11 +71,13 @@ async fn main(spawner: Spawner) {
71 let seed = 0x0123_4567_89ab_cdef; // chosen by fair dice roll. guarenteed to be random. 71 let seed = 0x0123_4567_89ab_cdef; // chosen by fair dice roll. guarenteed to be random.
72 72
73 // Init network stack 73 // Init network stack
74 let stack = &*make_static!(Stack::new( 74 static STACK: StaticCell<Stack<cyw43::NetDriver<'static>>> = StaticCell::new();
75 static RESOURCES: StaticCell<StackResources<2>> = StaticCell::new();
76 let stack = &*STACK.init(Stack::new(
75 net_device, 77 net_device,
76 Config::dhcpv4(Default::default()), 78 Config::dhcpv4(Default::default()),
77 make_static!(StackResources::<2>::new()), 79 RESOURCES.init(StackResources::<2>::new()),
78 seed 80 seed,
79 )); 81 ));
80 82
81 unwrap!(spawner.spawn(net_task(stack))); 83 unwrap!(spawner.spawn(net_task(stack)));
diff --git a/tests/rp/src/bin/ethernet_w5100s_perf.rs b/tests/rp/src/bin/ethernet_w5100s_perf.rs
index a4d253b3c..8c9089d0e 100644
--- a/tests/rp/src/bin/ethernet_w5100s_perf.rs
+++ b/tests/rp/src/bin/ethernet_w5100s_perf.rs
@@ -1,6 +1,5 @@
1#![no_std] 1#![no_std]
2#![no_main] 2#![no_main]
3#![feature(type_alias_impl_trait)]
4teleprobe_meta::target!(b"w5100s-evb-pico"); 3teleprobe_meta::target!(b"w5100s-evb-pico");
5teleprobe_meta::timeout!(120); 4teleprobe_meta::timeout!(120);
6 5
@@ -16,7 +15,7 @@ use embassy_rp::spi::{Async, Config as SpiConfig, Spi};
16use embassy_time::Delay; 15use embassy_time::Delay;
17use embedded_hal_bus::spi::ExclusiveDevice; 16use embedded_hal_bus::spi::ExclusiveDevice;
18use rand::RngCore; 17use rand::RngCore;
19use static_cell::make_static; 18use static_cell::StaticCell;
20use {defmt_rtt as _, panic_probe as _}; 19use {defmt_rtt as _, panic_probe as _};
21 20
22#[embassy_executor::task] 21#[embassy_executor::task]
@@ -51,7 +50,8 @@ async fn main(spawner: Spawner) {
51 let w5500_reset = Output::new(p.PIN_20, Level::High); 50 let w5500_reset = Output::new(p.PIN_20, Level::High);
52 51
53 let mac_addr = [0x02, 0x00, 0x00, 0x00, 0x00, 0x00]; 52 let mac_addr = [0x02, 0x00, 0x00, 0x00, 0x00, 0x00];
54 let state = make_static!(State::<8, 8>::new()); 53 static STATE: StaticCell<State<8, 8>> = StaticCell::new();
54 let state = STATE.init(State::<8, 8>::new());
55 let (device, runner) = embassy_net_wiznet::new( 55 let (device, runner) = embassy_net_wiznet::new(
56 mac_addr, 56 mac_addr,
57 state, 57 state,
@@ -66,11 +66,13 @@ async fn main(spawner: Spawner) {
66 let seed = rng.next_u64(); 66 let seed = rng.next_u64();
67 67
68 // Init network stack 68 // Init network stack
69 let stack = &*make_static!(Stack::new( 69 static STACK: StaticCell<Stack<Device<'static>>> = StaticCell::new();
70 static RESOURCES: StaticCell<StackResources<2>> = StaticCell::new();
71 let stack = &*STACK.init(Stack::new(
70 device, 72 device,
71 embassy_net::Config::dhcpv4(Default::default()), 73 embassy_net::Config::dhcpv4(Default::default()),
72 make_static!(StackResources::<2>::new()), 74 RESOURCES.init(StackResources::<2>::new()),
73 seed 75 seed,
74 )); 76 ));
75 77
76 // Launch network task 78 // Launch network task
diff --git a/tests/rp/src/bin/gpio.rs b/tests/rp/src/bin/gpio.rs
index e0c309887..a57d5d9e8 100644
--- a/tests/rp/src/bin/gpio.rs
+++ b/tests/rp/src/bin/gpio.rs
@@ -16,10 +16,10 @@ async fn main(_spawner: Spawner) {
16 16
17 // Test initial output 17 // Test initial output
18 { 18 {
19 let b = Input::new(&mut b, Pull::None); 19 let mut b = Input::new(&mut b, Pull::None);
20 20
21 { 21 {
22 let a = Output::new(&mut a, Level::Low); 22 let mut a = Output::new(&mut a, Level::Low);
23 delay(); 23 delay();
24 assert!(b.is_low()); 24 assert!(b.is_low());
25 assert!(!b.is_high()); 25 assert!(!b.is_high());
@@ -64,7 +64,7 @@ async fn main(_spawner: Spawner) {
64 64
65 // Test input no pull 65 // Test input no pull
66 { 66 {
67 let b = Input::new(&mut b, Pull::None); 67 let mut b = Input::new(&mut b, Pull::None);
68 // no pull, the status is undefined 68 // no pull, the status is undefined
69 69
70 let mut a = Output::new(&mut a, Level::Low); 70 let mut a = Output::new(&mut a, Level::Low);
@@ -77,7 +77,7 @@ async fn main(_spawner: Spawner) {
77 77
78 // Test input pulldown 78 // Test input pulldown
79 { 79 {
80 let b = Input::new(&mut b, Pull::Down); 80 let mut b = Input::new(&mut b, Pull::Down);
81 delay(); 81 delay();
82 assert!(b.is_low()); 82 assert!(b.is_low());
83 83
@@ -91,7 +91,7 @@ async fn main(_spawner: Spawner) {
91 91
92 // Test input pullup 92 // Test input pullup
93 { 93 {
94 let b = Input::new(&mut b, Pull::Up); 94 let mut b = Input::new(&mut b, Pull::Up);
95 delay(); 95 delay();
96 assert!(b.is_high()); 96 assert!(b.is_high());
97 97
diff --git a/tests/rp/src/bin/pwm.rs b/tests/rp/src/bin/pwm.rs
index e71d9e610..3fc0bb2a0 100644
--- a/tests/rp/src/bin/pwm.rs
+++ b/tests/rp/src/bin/pwm.rs
@@ -45,7 +45,7 @@ async fn main(_spawner: Spawner) {
45 45
46 // Test output from A 46 // Test output from A
47 { 47 {
48 let pin1 = Input::new(&mut p9, Pull::None); 48 let mut pin1 = Input::new(&mut p9, Pull::None);
49 let _pwm = Pwm::new_output_a(&mut p.PWM_CH3, &mut p6, cfg.clone()); 49 let _pwm = Pwm::new_output_a(&mut p.PWM_CH3, &mut p6, cfg.clone());
50 Timer::after_millis(1).await; 50 Timer::after_millis(1).await;
51 assert_eq!(pin1.is_low(), invert_a); 51 assert_eq!(pin1.is_low(), invert_a);
@@ -59,7 +59,7 @@ async fn main(_spawner: Spawner) {
59 59
60 // Test output from B 60 // Test output from B
61 { 61 {
62 let pin2 = Input::new(&mut p11, Pull::None); 62 let mut pin2 = Input::new(&mut p11, Pull::None);
63 let _pwm = Pwm::new_output_b(&mut p.PWM_CH3, &mut p7, cfg.clone()); 63 let _pwm = Pwm::new_output_b(&mut p.PWM_CH3, &mut p7, cfg.clone());
64 Timer::after_millis(1).await; 64 Timer::after_millis(1).await;
65 assert_ne!(pin2.is_low(), invert_a); 65 assert_ne!(pin2.is_low(), invert_a);
@@ -73,8 +73,8 @@ async fn main(_spawner: Spawner) {
73 73
74 // Test output from A+B 74 // Test output from A+B
75 { 75 {
76 let pin1 = Input::new(&mut p9, Pull::None); 76 let mut pin1 = Input::new(&mut p9, Pull::None);
77 let pin2 = Input::new(&mut p11, Pull::None); 77 let mut pin2 = Input::new(&mut p11, Pull::None);
78 let _pwm = Pwm::new_output_ab(&mut p.PWM_CH3, &mut p6, &mut p7, cfg.clone()); 78 let _pwm = Pwm::new_output_ab(&mut p.PWM_CH3, &mut p6, &mut p7, cfg.clone());
79 Timer::after_millis(1).await; 79 Timer::after_millis(1).await;
80 assert_eq!(pin1.is_low(), invert_a); 80 assert_eq!(pin1.is_low(), invert_a);
diff --git a/tests/stm32/Cargo.toml b/tests/stm32/Cargo.toml
index 4f53e84f0..c60b28a7a 100644
--- a/tests/stm32/Cargo.toml
+++ b/tests/stm32/Cargo.toml
@@ -63,13 +63,13 @@ defmt-rtt = "0.4"
63cortex-m = { version = "0.7.6", features = ["critical-section-single-core"] } 63cortex-m = { version = "0.7.6", features = ["critical-section-single-core"] }
64cortex-m-rt = "0.7.0" 64cortex-m-rt = "0.7.0"
65embedded-hal = "0.2.6" 65embedded-hal = "0.2.6"
66embedded-hal-1 = { package = "embedded-hal", version = "=1.0.0-rc.2" } 66embedded-hal-1 = { package = "embedded-hal", version = "=1.0.0-rc.3" }
67embedded-hal-async = { version = "=1.0.0-rc.2" } 67embedded-hal-async = { version = "=1.0.0-rc.3" }
68micromath = "2.0.0" 68micromath = "2.0.0"
69panic-probe = { version = "0.3.0", features = ["print-defmt"] } 69panic-probe = { version = "0.3.0", features = ["print-defmt"] }
70rand_core = { version = "0.6", default-features = false } 70rand_core = { version = "0.6", default-features = false }
71rand_chacha = { version = "0.3", default-features = false } 71rand_chacha = { version = "0.3", default-features = false }
72static_cell = { version = "2", features = ["nightly"] } 72static_cell = "2"
73portable-atomic = { version = "1.5", features = [] } 73portable-atomic = { version = "1.5", features = [] }
74 74
75chrono = { version = "^0.4", default-features = false, optional = true} 75chrono = { version = "^0.4", default-features = false, optional = true}
diff --git a/tests/stm32/src/bin/eth.rs b/tests/stm32/src/bin/eth.rs
index 754354944..7c02f0354 100644
--- a/tests/stm32/src/bin/eth.rs
+++ b/tests/stm32/src/bin/eth.rs
@@ -1,7 +1,6 @@
1// required-features: eth 1// required-features: eth
2#![no_std] 2#![no_std]
3#![no_main] 3#![no_main]
4#![feature(type_alias_impl_trait)]
5 4
6#[path = "../common.rs"] 5#[path = "../common.rs"]
7mod common; 6mod common;
@@ -14,7 +13,7 @@ use embassy_stm32::peripherals::ETH;
14use embassy_stm32::rng::Rng; 13use embassy_stm32::rng::Rng;
15use embassy_stm32::{bind_interrupts, eth, peripherals, rng}; 14use embassy_stm32::{bind_interrupts, eth, peripherals, rng};
16use rand_core::RngCore; 15use rand_core::RngCore;
17use static_cell::make_static; 16use static_cell::StaticCell;
18use {defmt_rtt as _, panic_probe as _}; 17use {defmt_rtt as _, panic_probe as _};
19 18
20teleprobe_meta::timeout!(120); 19teleprobe_meta::timeout!(120);
@@ -71,8 +70,9 @@ async fn main(spawner: Spawner) {
71 #[cfg(not(feature = "stm32f207zg"))] 70 #[cfg(not(feature = "stm32f207zg"))]
72 const PACKET_QUEUE_SIZE: usize = 4; 71 const PACKET_QUEUE_SIZE: usize = 4;
73 72
73 static PACKETS: StaticCell<PacketQueue<PACKET_QUEUE_SIZE, PACKET_QUEUE_SIZE>> = StaticCell::new();
74 let device = Ethernet::new( 74 let device = Ethernet::new(
75 make_static!(PacketQueue::<PACKET_QUEUE_SIZE, PACKET_QUEUE_SIZE>::new()), 75 PACKETS.init(PacketQueue::<PACKET_QUEUE_SIZE, PACKET_QUEUE_SIZE>::new()),
76 p.ETH, 76 p.ETH,
77 Irqs, 77 Irqs,
78 p.PA1, 78 p.PA1,
@@ -99,11 +99,13 @@ async fn main(spawner: Spawner) {
99 //}); 99 //});
100 100
101 // Init network stack 101 // Init network stack
102 let stack = &*make_static!(Stack::new( 102 static STACK: StaticCell<Stack<Device>> = StaticCell::new();
103 static RESOURCES: StaticCell<StackResources<2>> = StaticCell::new();
104 let stack = &*STACK.init(Stack::new(
103 device, 105 device,
104 config, 106 config,
105 make_static!(StackResources::<2>::new()), 107 RESOURCES.init(StackResources::<2>::new()),
106 seed 108 seed,
107 )); 109 ));
108 110
109 // Launch network task 111 // Launch network task
diff --git a/tests/stm32/src/bin/gpio.rs b/tests/stm32/src/bin/gpio.rs
index c4e2fe161..9f1993024 100644
--- a/tests/stm32/src/bin/gpio.rs
+++ b/tests/stm32/src/bin/gpio.rs
@@ -20,10 +20,10 @@ async fn main(_spawner: Spawner) {
20 20
21 // Test initial output 21 // Test initial output
22 { 22 {
23 let b = Input::new(&mut b, Pull::None); 23 let mut b = Input::new(&mut b, Pull::None);
24 24
25 { 25 {
26 let a = Output::new(&mut a, Level::Low, Speed::Low); 26 let mut a = Output::new(&mut a, Level::Low, Speed::Low);
27 delay(); 27 delay();
28 assert!(b.is_low()); 28 assert!(b.is_low());
29 assert!(!b.is_high()); 29 assert!(!b.is_high());
@@ -68,7 +68,7 @@ async fn main(_spawner: Spawner) {
68 68
69 // Test input no pull 69 // Test input no pull
70 { 70 {
71 let b = Input::new(&mut b, Pull::None); 71 let mut b = Input::new(&mut b, Pull::None);
72 // no pull, the status is undefined 72 // no pull, the status is undefined
73 73
74 let mut a = Output::new(&mut a, Level::Low, Speed::Low); 74 let mut a = Output::new(&mut a, Level::Low, Speed::Low);
@@ -81,7 +81,7 @@ async fn main(_spawner: Spawner) {
81 81
82 // Test input pulldown 82 // Test input pulldown
83 { 83 {
84 let b = Input::new(&mut b, Pull::Down); 84 let mut b = Input::new(&mut b, Pull::Down);
85 delay(); 85 delay();
86 assert!(b.is_low()); 86 assert!(b.is_low());
87 87
@@ -95,7 +95,7 @@ async fn main(_spawner: Spawner) {
95 95
96 // Test input pullup 96 // Test input pullup
97 { 97 {
98 let b = Input::new(&mut b, Pull::Up); 98 let mut b = Input::new(&mut b, Pull::Up);
99 delay(); 99 delay();
100 assert!(b.is_high()); 100 assert!(b.is_high());
101 101
@@ -109,7 +109,7 @@ async fn main(_spawner: Spawner) {
109 109
110 // Test output open drain 110 // Test output open drain
111 { 111 {
112 let b = Input::new(&mut b, Pull::Down); 112 let mut b = Input::new(&mut b, Pull::Down);
113 // no pull, the status is undefined 113 // no pull, the status is undefined
114 114
115 let mut a = OutputOpenDrain::new(&mut a, Level::Low, Speed::Low, Pull::None); 115 let mut a = OutputOpenDrain::new(&mut a, Level::Low, Speed::Low, Pull::None);
diff --git a/tests/stm32/src/bin/stop.rs b/tests/stm32/src/bin/stop.rs
index b9810673a..000296d46 100644
--- a/tests/stm32/src/bin/stop.rs
+++ b/tests/stm32/src/bin/stop.rs
@@ -2,7 +2,6 @@
2 2
3#![no_std] 3#![no_std]
4#![no_main] 4#![no_main]
5#![feature(type_alias_impl_trait)]
6#[path = "../common.rs"] 5#[path = "../common.rs"]
7mod common; 6mod common;
8 7
@@ -15,7 +14,7 @@ use embassy_stm32::rcc::LsConfig;
15use embassy_stm32::rtc::{Rtc, RtcConfig}; 14use embassy_stm32::rtc::{Rtc, RtcConfig};
16use embassy_stm32::Config; 15use embassy_stm32::Config;
17use embassy_time::Timer; 16use embassy_time::Timer;
18use static_cell::make_static; 17use static_cell::StaticCell;
19 18
20#[entry] 19#[entry]
21fn main() -> ! { 20fn main() -> ! {
@@ -64,7 +63,8 @@ async fn async_main(spawner: Spawner) {
64 63
65 rtc.set_datetime(now.into()).expect("datetime not set"); 64 rtc.set_datetime(now.into()).expect("datetime not set");
66 65
67 let rtc = make_static!(rtc); 66 static RTC: StaticCell<Rtc> = StaticCell::new();
67 let rtc = RTC.init(rtc);
68 68
69 stop_with_rtc(rtc); 69 stop_with_rtc(rtc);
70 70