aboutsummaryrefslogtreecommitdiff
path: root/examples/stm32h5
diff options
context:
space:
mode:
authorUlf Lilleengen <[email protected]>2023-12-21 08:50:54 +0100
committerUlf Lilleengen <[email protected]>2023-12-21 10:29:57 +0100
commit0acf7b09c3bc9176d00479d601356d8df2537a9b (patch)
tree7a04543c661b38b6aba8893c9150ef8090199ee5 /examples/stm32h5
parentd832d45c0ba5f2624a5f5c1e549e2d7fe8bd0e01 (diff)
chore: replace make_static! macro usage with non-macro version
Diffstat (limited to 'examples/stm32h5')
-rw-r--r--examples/stm32h5/src/bin/eth.rs13
1 files changed, 8 insertions, 5 deletions
diff --git a/examples/stm32h5/src/bin/eth.rs b/examples/stm32h5/src/bin/eth.rs
index b2758cba0..8789e4e0b 100644
--- a/examples/stm32h5/src/bin/eth.rs
+++ b/examples/stm32h5/src/bin/eth.rs
@@ -18,7 +18,7 @@ use embassy_stm32::{bind_interrupts, eth, peripherals, rng, Config};
18use embassy_time::Timer; 18use embassy_time::Timer;
19use embedded_io_async::Write; 19use embedded_io_async::Write;
20use rand_core::RngCore; 20use rand_core::RngCore;
21use static_cell::make_static; 21use static_cell::StaticCell;
22use {defmt_rtt as _, panic_probe as _}; 22use {defmt_rtt as _, panic_probe as _};
23 23
24bind_interrupts!(struct Irqs { 24bind_interrupts!(struct Irqs {
@@ -67,8 +67,9 @@ async fn main(spawner: Spawner) -> ! {
67 67
68 let mac_addr = [0x00, 0x00, 0xDE, 0xAD, 0xBE, 0xEF]; 68 let mac_addr = [0x00, 0x00, 0xDE, 0xAD, 0xBE, 0xEF];
69 69
70 static PACKETS: StaticCell<PacketQueue<4, 4>> = StaticCell::new();
70 let device = Ethernet::new( 71 let device = Ethernet::new(
71 make_static!(PacketQueue::<4, 4>::new()), 72 PACKETS.init(PacketQueue::<4, 4>::new()),
72 p.ETH, 73 p.ETH,
73 Irqs, 74 Irqs,
74 p.PA1, 75 p.PA1,
@@ -92,11 +93,13 @@ async fn main(spawner: Spawner) -> ! {
92 //}); 93 //});
93 94
94 // Init network stack 95 // Init network stack
95 let stack = &*make_static!(Stack::new( 96 static STACK: StaticCell<Stack<Device>> = StaticCell::new();
97 static RESOURCES: StaticCell<StackResources<2>> = StaticCell::new();
98 let stack = &*STACK.init(Stack::new(
96 device, 99 device,
97 config, 100 config,
98 make_static!(StackResources::<2>::new()), 101 RESOURCES.init(StackResources::<2>::new()),
99 seed 102 seed,
100 )); 103 ));
101 104
102 // Launch network task 105 // Launch network task