forked from M-Labs/artiq
1
0
Fork 0

firmware: update smoltcp.

This commit is contained in:
whitequark 2017-08-30 14:35:45 +00:00
parent 2231b16e0a
commit 39ecbc0d68
3 changed files with 13 additions and 13 deletions

View File

@ -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)" = "<none>"
"checksum smoltcp 0.4.0-pre (git+https://github.com/m-labs/smoltcp?rev=b927085)" = "<none>"
"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"

View File

@ -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"]

View File

@ -106,14 +106,15 @@ fn startup() {
}
}
fn _net_trace_writer<U>(printer: smoltcp::wire::PrettyPrinter<U>)
where U: smoltcp::wire::pretty_print::PrettyPrint {
print!("\x1b[37m{}\x1b[0m", printer)
}
// fn _net_trace_writer<U>(timestamp: u64, printer: smoltcp::wire::PrettyPrinter<U>)
// 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<smoltcp::iface::ArpCache>,
@ -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)
}
}
}