chore: replace make_static! macro usage with non-macro version

This commit is contained in:
Ulf Lilleengen
2023-12-21 08:50:54 +01:00
parent d832d45c0b
commit 0acf7b09c3
37 changed files with 313 additions and 188 deletions

View File

@ -36,7 +36,7 @@ use hal::rng::{self, Rng};
use hal::{bind_interrupts, exti, pac, peripherals};
use heapless::Vec;
use rand::RngCore;
use static_cell::make_static;
use static_cell::StaticCell;
use {embassy_stm32 as hal, panic_probe as _};
bind_interrupts!(struct Irqs {
@ -180,7 +180,8 @@ async fn main(spawner: Spawner) {
}
};
let state = make_static!(embassy_net_adin1110::State::<8, 8>::new());
static STATE: StaticCell<embassy_net_adin1110::State<8, 8>> = StaticCell::new();
let state = STATE.init(embassy_net_adin1110::State::<8, 8>::new());
let (device, runner) = embassy_net_adin1110::new(
MAC,
@ -217,11 +218,13 @@ async fn main(spawner: Spawner) {
};
// Init network stack
let stack = &*make_static!(Stack::new(
static STACK: StaticCell<Stack<Device<'static>>> = StaticCell::new();
static RESOURCES: StaticCell<StackResources<2>> = StaticCell::new();
let stack = &*STACK.init(Stack::new(
device,
ip_cfg,
make_static!(StackResources::<2>::new()),
seed
RESOURCES.init(StackResources::<2>::new()),
seed,
));
// Launch network task