aboutsummaryrefslogtreecommitdiff
path: root/examples/stm32f4
diff options
context:
space:
mode:
authorDario Nieuwenhuis <[email protected]>2023-03-01 01:59:41 +0100
committerGitHub <[email protected]>2023-03-01 01:59:41 +0100
commit66ca57312f62bdf83cd30a9d2449962416fcd99c (patch)
treed84accfcb94bae68b3983a8a2518689cf868bcc1 /examples/stm32f4
parent711ce1014552b715190b1ee6780cafc92fe54240 (diff)
parent6dbb631f1ecb75361ee70da91f50779c29f23482 (diff)
Merge pull request #1251 from embassy-rs/fix-examples
Example fixes.
Diffstat (limited to 'examples/stm32f4')
-rw-r--r--examples/stm32f4/Cargo.toml6
-rw-r--r--examples/stm32f4/src/bin/usb_ethernet.rs11
2 files changed, 4 insertions, 13 deletions
diff --git a/examples/stm32f4/Cargo.toml b/examples/stm32f4/Cargo.toml
index e2b17bfcb..7a7bab5bb 100644
--- a/examples/stm32f4/Cargo.toml
+++ b/examples/stm32f4/Cargo.toml
@@ -10,7 +10,7 @@ embassy-executor = { version = "0.1.0", path = "../../embassy-executor", feature
10embassy-time = { version = "0.1.0", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "unstable-traits", "tick-hz-32_768"] } 10embassy-time = { version = "0.1.0", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "unstable-traits", "tick-hz-32_768"] }
11embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["nightly", "unstable-traits", "defmt", "stm32f429zi", "unstable-pac", "memory-x", "time-driver-any", "exti"] } 11embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["nightly", "unstable-traits", "defmt", "stm32f429zi", "unstable-pac", "memory-x", "time-driver-any", "exti"] }
12embassy-usb = { version = "0.1.0", path = "../../embassy-usb", features = ["defmt"] } 12embassy-usb = { version = "0.1.0", path = "../../embassy-usb", features = ["defmt"] }
13embassy-net = { version = "0.1.0", path = "../../embassy-net", features = ["defmt", "tcp", "dhcpv4", "medium-ethernet", "nightly"], optional = true } 13embassy-net = { version = "0.1.0", path = "../../embassy-net", features = ["defmt", "tcp", "dhcpv4", "medium-ethernet", "nightly"] }
14 14
15defmt = "0.3" 15defmt = "0.3"
16defmt-rtt = "0.4" 16defmt-rtt = "0.4"
@@ -27,9 +27,5 @@ embedded-storage = "0.3.0"
27micromath = "2.0.0" 27micromath = "2.0.0"
28static_cell = "1.0" 28static_cell = "1.0"
29 29
30[[bin]]
31name = "usb_ethernet"
32required-features = ["embassy-net"]
33
34[profile.release] 30[profile.release]
35debug = 2 31debug = 2
diff --git a/examples/stm32f4/src/bin/usb_ethernet.rs b/examples/stm32f4/src/bin/usb_ethernet.rs
index 4a16aac07..db9e18393 100644
--- a/examples/stm32f4/src/bin/usb_ethernet.rs
+++ b/examples/stm32f4/src/bin/usb_ethernet.rs
@@ -100,8 +100,8 @@ async fn main(spawner: Spawner) {
100 let (runner, device) = class.into_embassy_net_device::<MTU, 4, 4>(singleton!(NetState::new()), our_mac_addr); 100 let (runner, device) = class.into_embassy_net_device::<MTU, 4, 4>(singleton!(NetState::new()), our_mac_addr);
101 unwrap!(spawner.spawn(usb_ncm_task(runner))); 101 unwrap!(spawner.spawn(usb_ncm_task(runner)));
102 102
103 let config = embassy_net::ConfigStrategy::Dhcp; 103 let config = embassy_net::Config::Dhcp(Default::default());
104 //let config = embassy_net::ConfigStrategy::Static(embassy_net::Config { 104 //let config = embassy_net::Config::Static(embassy_net::StaticConfig {
105 // address: Ipv4Cidr::new(Ipv4Address::new(10, 42, 0, 61), 24), 105 // address: Ipv4Cidr::new(Ipv4Address::new(10, 42, 0, 61), 24),
106 // dns_servers: Vec::new(), 106 // dns_servers: Vec::new(),
107 // gateway: Some(Ipv4Address::new(10, 42, 0, 1)), 107 // gateway: Some(Ipv4Address::new(10, 42, 0, 1)),
@@ -114,12 +114,7 @@ async fn main(spawner: Spawner) {
114 let seed = u64::from_le_bytes(seed); 114 let seed = u64::from_le_bytes(seed);
115 115
116 // Init network stack 116 // Init network stack
117 let stack = &*singleton!(Stack::new( 117 let stack = &*singleton!(Stack::new(device, config, singleton!(StackResources::<2>::new()), seed));
118 device,
119 config,
120 singleton!(StackResources::<1, 2, 8>::new()),
121 seed
122 ));
123 118
124 unwrap!(spawner.spawn(net_task(stack))); 119 unwrap!(spawner.spawn(net_task(stack)));
125 120