diff options
| author | Ulf Lilleengen <[email protected]> | 2023-12-21 08:50:54 +0100 |
|---|---|---|
| committer | Ulf Lilleengen <[email protected]> | 2023-12-21 10:29:57 +0100 |
| commit | 0acf7b09c3bc9176d00479d601356d8df2537a9b (patch) | |
| tree | 7a04543c661b38b6aba8893c9150ef8090199ee5 /examples/stm32l4/src | |
| parent | d832d45c0ba5f2624a5f5c1e549e2d7fe8bd0e01 (diff) | |
chore: replace make_static! macro usage with non-macro version
Diffstat (limited to 'examples/stm32l4/src')
| -rw-r--r-- | examples/stm32l4/src/bin/spe_adin1110_http_server.rs | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/examples/stm32l4/src/bin/spe_adin1110_http_server.rs b/examples/stm32l4/src/bin/spe_adin1110_http_server.rs index 8ec810c7f..eb04fe5e6 100644 --- a/examples/stm32l4/src/bin/spe_adin1110_http_server.rs +++ b/examples/stm32l4/src/bin/spe_adin1110_http_server.rs | |||
| @@ -36,7 +36,7 @@ use hal::rng::{self, Rng}; | |||
| 36 | use hal::{bind_interrupts, exti, pac, peripherals}; | 36 | use hal::{bind_interrupts, exti, pac, peripherals}; |
| 37 | use heapless::Vec; | 37 | use heapless::Vec; |
| 38 | use rand::RngCore; | 38 | use rand::RngCore; |
| 39 | use static_cell::make_static; | 39 | use static_cell::StaticCell; |
| 40 | use {embassy_stm32 as hal, panic_probe as _}; | 40 | use {embassy_stm32 as hal, panic_probe as _}; |
| 41 | 41 | ||
| 42 | bind_interrupts!(struct Irqs { | 42 | bind_interrupts!(struct Irqs { |
| @@ -180,7 +180,8 @@ async fn main(spawner: Spawner) { | |||
| 180 | } | 180 | } |
| 181 | }; | 181 | }; |
| 182 | 182 | ||
| 183 | let state = make_static!(embassy_net_adin1110::State::<8, 8>::new()); | 183 | static STATE: StaticCell<embassy_net_adin1110::State<8, 8>> = StaticCell::new(); |
| 184 | let state = STATE.init(embassy_net_adin1110::State::<8, 8>::new()); | ||
| 184 | 185 | ||
| 185 | let (device, runner) = embassy_net_adin1110::new( | 186 | let (device, runner) = embassy_net_adin1110::new( |
| 186 | MAC, | 187 | MAC, |
| @@ -217,11 +218,13 @@ async fn main(spawner: Spawner) { | |||
| 217 | }; | 218 | }; |
| 218 | 219 | ||
| 219 | // Init network stack | 220 | // Init network stack |
| 220 | let stack = &*make_static!(Stack::new( | 221 | static STACK: StaticCell<Stack<Device<'static>>> = StaticCell::new(); |
| 222 | static RESOURCES: StaticCell<StackResources<2>> = StaticCell::new(); | ||
| 223 | let stack = &*STACK.init(Stack::new( | ||
| 221 | device, | 224 | device, |
| 222 | ip_cfg, | 225 | ip_cfg, |
| 223 | make_static!(StackResources::<2>::new()), | 226 | RESOURCES.init(StackResources::<2>::new()), |
| 224 | seed | 227 | seed, |
| 225 | )); | 228 | )); |
| 226 | 229 | ||
| 227 | // Launch network task | 230 | // Launch network task |
