Skip to content

Commit 891c5ee

Browse files
authored
Merge pull request #3232 from embassy-rs/misc-fixes-44
Misc fixes.
2 parents d3ff0b1 + 59cb153 commit 891c5ee

File tree

29 files changed

+50
-128
lines changed

29 files changed

+50
-128
lines changed

embassy-net-esp-hosted/src/proto.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#![allow(unused)]
2+
13
use heapless::{String, Vec};
24

35
/// internal supporting structures for CtrlMsg

embassy-net/src/lib.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -415,8 +415,11 @@ impl<D: Driver> Stack<D> {
415415
/// ## Example
416416
/// ```ignore
417417
/// let config = embassy_net::Config::dhcpv4(Default::default());
418-
///// Init network stack
419-
/// static RESOURCES: StaticCell<embassy_net::StackResources<2>> = StaticCell::new();
418+
/// // Init network stack
419+
/// // NOTE: DHCP and DNS need one socket slot if enabled. This is why we're
420+
/// // provisioning space for 3 sockets here: one for DHCP, one for DNS, and one for your code (e.g. TCP).
421+
/// // If you use more sockets you must increase this. If you don't enable DHCP or DNS you can decrease it.
422+
/// static RESOURCES: StaticCell<embassy_net::StackResources<3>> = StaticCell::new();
420423
/// static STACK: StaticCell<embassy_net::Stack> = StaticCell::new();
421424
/// let stack = &*STACK.init(embassy_net::Stack::new(
422425
/// device,

embassy-stm32-wpan/src/mac/commands.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#![allow(unused)]
2+
13
use core::{mem, slice};
24

35
use super::opcodes::OpcodeM4ToM0;

examples/nrf52840/src/bin/ethernet_enc28j60.rs

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -66,16 +66,11 @@ async fn main(spawner: Spawner) {
6666
let seed = u64::from_le_bytes(seed);
6767

6868
// Init network stack
69-
static RESOURCES: StaticCell<StackResources<2>> = StaticCell::new();
69+
static RESOURCES: StaticCell<StackResources<3>> = StaticCell::new();
7070
static STACK: StaticCell<
7171
Stack<Enc28j60<ExclusiveDevice<Spim<'static, peripherals::SPI3>, Output<'static>, Delay>, Output<'static>>>,
7272
> = StaticCell::new();
73-
let stack = STACK.init(Stack::new(
74-
device,
75-
config,
76-
RESOURCES.init(StackResources::<2>::new()),
77-
seed,
78-
));
73+
let stack = STACK.init(Stack::new(device, config, RESOURCES.init(StackResources::new()), seed));
7974

8075
unwrap!(spawner.spawn(net_task(stack)));
8176

examples/nrf52840/src/bin/usb_ethernet.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ async fn main(spawner: Spawner) {
115115
let seed = u64::from_le_bytes(seed);
116116

117117
// Init network stack
118-
static RESOURCES: StaticCell<StackResources<2>> = StaticCell::new();
118+
static RESOURCES: StaticCell<StackResources<3>> = StaticCell::new();
119119
static STACK: StaticCell<Stack<Device<'static, MTU>>> = StaticCell::new();
120120
let stack = &*STACK.init(Stack::new(device, config, RESOURCES.init(StackResources::new()), seed));
121121

examples/nrf52840/src/bin/wifi_esp_hosted.rs

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -89,14 +89,9 @@ async fn main(spawner: Spawner) {
8989
let seed = u64::from_le_bytes(seed);
9090

9191
// Init network stack
92-
static RESOURCES: StaticCell<StackResources<2>> = StaticCell::new();
92+
static RESOURCES: StaticCell<StackResources<3>> = StaticCell::new();
9393
static STACK: StaticCell<Stack<hosted::NetDriver<'static>>> = StaticCell::new();
94-
let stack = &*STACK.init(Stack::new(
95-
device,
96-
config,
97-
RESOURCES.init(StackResources::<2>::new()),
98-
seed,
99-
));
94+
let stack = &*STACK.init(Stack::new(device, config, RESOURCES.init(StackResources::new()), seed));
10095

10196
unwrap!(spawner.spawn(net_task(stack)));
10297

examples/rp/src/bin/ethernet_w5500_multisocket.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ async fn main(spawner: Spawner) {
7676
let stack = &*STACK.init(Stack::new(
7777
device,
7878
embassy_net::Config::dhcpv4(Default::default()),
79-
RESOURCES.init(StackResources::<3>::new()),
79+
RESOURCES.init(StackResources::new()),
8080
seed,
8181
));
8282

examples/rp/src/bin/ethernet_w5500_tcp_client.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,11 +75,11 @@ async fn main(spawner: Spawner) {
7575

7676
// Init network stack
7777
static STACK: StaticCell<Stack<Device<'static>>> = StaticCell::new();
78-
static RESOURCES: StaticCell<StackResources<2>> = StaticCell::new();
78+
static RESOURCES: StaticCell<StackResources<3>> = StaticCell::new();
7979
let stack = &*STACK.init(Stack::new(
8080
device,
8181
embassy_net::Config::dhcpv4(Default::default()),
82-
RESOURCES.init(StackResources::<2>::new()),
82+
RESOURCES.init(StackResources::new()),
8383
seed,
8484
));
8585

examples/rp/src/bin/ethernet_w5500_tcp_server.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,11 +74,11 @@ async fn main(spawner: Spawner) {
7474

7575
// Init network stack
7676
static STACK: StaticCell<Stack<Device<'static>>> = StaticCell::new();
77-
static RESOURCES: StaticCell<StackResources<2>> = StaticCell::new();
77+
static RESOURCES: StaticCell<StackResources<3>> = StaticCell::new();
7878
let stack = &*STACK.init(Stack::new(
7979
device,
8080
embassy_net::Config::dhcpv4(Default::default()),
81-
RESOURCES.init(StackResources::<2>::new()),
81+
RESOURCES.init(StackResources::new()),
8282
seed,
8383
));
8484

examples/rp/src/bin/ethernet_w5500_udp.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,11 +72,11 @@ async fn main(spawner: Spawner) {
7272

7373
// Init network stack
7474
static STACK: StaticCell<Stack<Device<'static>>> = StaticCell::new();
75-
static RESOURCES: StaticCell<StackResources<2>> = StaticCell::new();
75+
static RESOURCES: StaticCell<StackResources<3>> = StaticCell::new();
7676
let stack = &*STACK.init(Stack::new(
7777
device,
7878
embassy_net::Config::dhcpv4(Default::default()),
79-
RESOURCES.init(StackResources::<2>::new()),
79+
RESOURCES.init(StackResources::new()),
8080
seed,
8181
));
8282

0 commit comments

Comments
 (0)