mirror of
https://github.com/embassy-rs/embassy.git
synced 2024-11-21 22:32:29 +00:00
Simplify construction of StackResources::new()
This commit is contained in:
parent
891c5ee105
commit
961ec387ed
@ -67,12 +67,7 @@ async fn main(spawner: Spawner) {
|
||||
// Init network stack
|
||||
static STACK: StaticCell<Stack<MyDriver>> = StaticCell::new();
|
||||
static RESOURCES: StaticCell<StackResources<2>> = StaticCell::new();
|
||||
let stack = &*STACK.init(Stack::new(
|
||||
device,
|
||||
config,
|
||||
RESOURCES.init(StackResources::<2>::new()),
|
||||
seed,
|
||||
));
|
||||
let stack = &*STACK.init(Stack::new(device, config, RESOURCES.init(StackResources::new()), seed));
|
||||
|
||||
unwrap!(spawner.spawn(net_task(stack)));
|
||||
|
||||
|
@ -91,7 +91,7 @@ async fn main(spawner: Spawner) {
|
||||
let stack = &*STACK.init(Stack::new(
|
||||
device,
|
||||
Config::dhcpv4(Default::default()),
|
||||
RESOURCES.init(StackResources::<2>::new()),
|
||||
RESOURCES.init(StackResources::new()),
|
||||
seed,
|
||||
));
|
||||
|
||||
|
@ -74,7 +74,7 @@ async fn main(spawner: Spawner) {
|
||||
let stack = &*STACK.init(Stack::new(
|
||||
net_device,
|
||||
Config::dhcpv4(Default::default()),
|
||||
RESOURCES.init(StackResources::<2>::new()),
|
||||
RESOURCES.init(StackResources::new()),
|
||||
seed,
|
||||
));
|
||||
|
||||
|
@ -72,7 +72,7 @@ async fn main(spawner: Spawner) {
|
||||
let stack = &*STACK.init(Stack::new(
|
||||
device,
|
||||
embassy_net::Config::dhcpv4(Default::default()),
|
||||
RESOURCES.init(StackResources::<2>::new()),
|
||||
RESOURCES.init(StackResources::new()),
|
||||
seed,
|
||||
));
|
||||
|
||||
|
@ -101,12 +101,7 @@ async fn main(spawner: Spawner) {
|
||||
// Init network stack
|
||||
static STACK: StaticCell<Stack<Device>> = StaticCell::new();
|
||||
static RESOURCES: StaticCell<StackResources<2>> = StaticCell::new();
|
||||
let stack = &*STACK.init(Stack::new(
|
||||
device,
|
||||
config,
|
||||
RESOURCES.init(StackResources::<2>::new()),
|
||||
seed,
|
||||
));
|
||||
let stack = &*STACK.init(Stack::new(device, config, RESOURCES.init(StackResources::new()), seed));
|
||||
|
||||
// Launch network task
|
||||
unwrap!(spawner.spawn(net_task(&stack)));
|
||||
|
Loading…
Reference in New Issue
Block a user