From 6d058641176e9f76eada9f5ad49809367cd19500 Mon Sep 17 00:00:00 2001 From: Daniel Kenyon-Jones Date: Thu, 2 Jan 2025 13:25:45 +0000 Subject: [PATCH] Bump examples to smoltcp 0.12 --- examples/rp2040/Cargo.toml | 2 +- examples/rp2040/src/main.rs | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/examples/rp2040/Cargo.toml b/examples/rp2040/Cargo.toml index 47896f7..24cb130 100644 --- a/examples/rp2040/Cargo.toml +++ b/examples/rp2040/Cargo.toml @@ -18,7 +18,7 @@ defmt = "0.3" defmt-rtt = "0.4" panic-probe = { version = "0.3", features = ["print-defmt"] } -smoltcp = { version = "0.11", default-features = false, features = [ +smoltcp = { version = "0.12", default-features = false, features = [ "defmt", "socket-tcp", "socket-dhcpv4", diff --git a/examples/rp2040/src/main.rs b/examples/rp2040/src/main.rs index abd4a89..0e28c9d 100644 --- a/examples/rp2040/src/main.rs +++ b/examples/rp2040/src/main.rs @@ -15,6 +15,7 @@ use hal::{clocks::init_clocks_and_plls, pac, watchdog::Watchdog}; use heapless::Vec; use panic_probe as _; use rp_pico as bsp; +use smoltcp::iface::PollResult; use smoltcp::socket::dhcpv4::RetryConfig; use smoltcp::time::Duration; use smoltcp::wire::DhcpOption; @@ -148,7 +149,9 @@ fn main() -> ! { let timestamp = Instant::from_micros(i64::try_from(timer.get_counter().ticks()).unwrap()); - if interface.poll(timestamp, &mut ethernet, &mut sockets) { + if let PollResult::SocketStateChanged = + interface.poll(timestamp, &mut ethernet, &mut sockets) + { dhcp_poll( &mut interface, sockets.get_mut::(dhcp_handle),