Skip to content

Commit

Permalink
Bump examples to smoltcp 0.12
Browse files Browse the repository at this point in the history
  • Loading branch information
dlkj committed Jan 2, 2025
1 parent d517a93 commit 6d05864
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion examples/rp2040/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
5 changes: 4 additions & 1 deletion examples/rp2040/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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::<dhcpv4::Socket>(dhcp_handle),
Expand Down

0 comments on commit 6d05864

Please sign in to comment.