From 39ecbc0d689d2c85279f99305865b02d4c56a602 Mon Sep 17 00:00:00 2001 From: whitequark Date: Wed, 30 Aug 2017 14:35:45 +0000 Subject: [PATCH] firmware: update smoltcp. --- artiq/firmware/Cargo.lock | 6 +++--- artiq/firmware/runtime/Cargo.toml | 2 +- artiq/firmware/runtime/lib.rs | 18 +++++++++--------- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/artiq/firmware/Cargo.lock b/artiq/firmware/Cargo.lock index 6ef0db1fb..0d7220265 100644 --- a/artiq/firmware/Cargo.lock +++ b/artiq/firmware/Cargo.lock @@ -157,7 +157,7 @@ dependencies = [ "log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", "logger_artiq 0.0.0", "proto 0.0.0", - "smoltcp 0.4.0-pre (git+https://github.com/m-labs/smoltcp?rev=bc2a894)", + "smoltcp 0.4.0-pre (git+https://github.com/m-labs/smoltcp?rev=b927085)", "std_artiq 0.0.0", ] @@ -183,7 +183,7 @@ dependencies = [ [[package]] name = "smoltcp" version = "0.4.0-pre" -source = "git+https://github.com/m-labs/smoltcp?rev=bc2a894#bc2a894c00c9e0cbc51d67c01f456e45b45abcc2" +source = "git+https://github.com/m-labs/smoltcp?rev=b927085#b92708596a09ff58c341be6bf42b38b00cc44657" dependencies = [ "byteorder 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", @@ -221,7 +221,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum log_buffer 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ec57723b84bbe7bdf76aa93169c9b59e67473317c6de3a83cb2a0f8ccb2aa493" "checksum managed 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "61eb783b4fa77e8fa4d27ec400f97ed9168546b8b30341a120b7ba9cc6571aaf" "checksum rustc-cfg 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "56a596b5718bf5e059d59a30af12f7f462a152de147aa462b70892849ee18704" -"checksum smoltcp 0.4.0-pre (git+https://github.com/m-labs/smoltcp?rev=bc2a894)" = "" +"checksum smoltcp 0.4.0-pre (git+https://github.com/m-labs/smoltcp?rev=b927085)" = "" "checksum walkdir 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "dd7c16466ecc507c7cb5988db03e6eab4aaeab89a5c37a29251fcfd3ac9b7afe" "checksum winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)" = "167dc9d6949a9b857f3451275e911c3f44255842c1f7a76f33c55103a909087a" "checksum winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "2d315eee3b34aca4797b2da6b13ed88266e6d612562a0c46390af8299fc699bc" diff --git a/artiq/firmware/runtime/Cargo.toml b/artiq/firmware/runtime/Cargo.toml index 069a8da1f..814120c19 100644 --- a/artiq/firmware/runtime/Cargo.toml +++ b/artiq/firmware/runtime/Cargo.toml @@ -32,6 +32,6 @@ features = ["mem"] [dependencies.smoltcp] git = "https://github.com/m-labs/smoltcp" -rev = "bc2a894" +rev = "b927085" default-features = false features = ["alloc", "collections", "log"]#, "verbose"] diff --git a/artiq/firmware/runtime/lib.rs b/artiq/firmware/runtime/lib.rs index f679eba28..af469147b 100644 --- a/artiq/firmware/runtime/lib.rs +++ b/artiq/firmware/runtime/lib.rs @@ -106,14 +106,15 @@ fn startup() { } } - fn _net_trace_writer(printer: smoltcp::wire::PrettyPrinter) - where U: smoltcp::wire::pretty_print::PrettyPrint { - print!("\x1b[37m{}\x1b[0m", printer) - } + // fn _net_trace_writer(timestamp: u64, printer: smoltcp::wire::PrettyPrinter) + // where U: smoltcp::wire::pretty_print::PrettyPrint { + // let seconds = timestamp / 1000; + // let micros = timestamp % 1000 * 1000; + // print!("\x1b[37m[{:6}.{:06}s]\n{}\x1b[0m", seconds, micros, printer) + // } let net_device = ethmac::EthernetDevice; - // let net_device = smoltcp::phy::Tracer::<_, smoltcp::wire::EthernetFrame<&[u8]>> - // ::new(net_device, _net_trace_writer); + // let net_device = smoltcp::phy::EthernetTracer::new(net_device, _net_trace_writer); let arp_cache = smoltcp::iface::SliceArpCache::new([Default::default(); 8]); let mut interface = smoltcp::iface::EthernetInterface::new( Box::new(net_device), Box::new(arp_cache) as Box, @@ -156,10 +157,9 @@ fn startup() { match interface.poll(&mut *borrow_mut!(scheduler.sockets()), board::clock::get_ms()) { - Ok(()) => (), - Err(smoltcp::Error::Exhausted) => (), + Ok(_poll_at) => (), Err(smoltcp::Error::Unrecognized) => (), - Err(e) => warn!("network error: {}", e) + Err(err) => warn!("network error: {}", err) } } }