cleanup unused deps, debug output

This commit is contained in:
Lotte Steenbrink 2020-06-19 11:02:18 +02:00
parent 482ddc59d0
commit 3fac13606e
3 changed files with 4 additions and 13 deletions

1
tools/Cargo.lock generated
View file

@ -169,7 +169,6 @@ dependencies = [
"probe-rs", "probe-rs",
"probe-rs-rtt", "probe-rs-rtt",
"rustc-demangle", "rustc-demangle",
"thiserror",
"xmas-elf", "xmas-elf",
] ]

View file

@ -14,5 +14,4 @@ log = "0.4.8"
probe-rs = "0.6.2" probe-rs = "0.6.2"
probe-rs-rtt = "0.1.0" probe-rs-rtt = "0.1.0"
rustc-demangle = "0.1.16" rustc-demangle = "0.1.16"
xmas-elf = "0.7.0" xmas-elf = "0.7.0"
thiserror = "1.0.11"

View file

@ -13,7 +13,6 @@ use std::{
process, process,
rc::Rc, rc::Rc,
}; };
use core::fmt::Error;
use anyhow::{anyhow, bail}; use anyhow::{anyhow, bail};
use arrayref::array_ref; use arrayref::array_ref;
@ -198,7 +197,6 @@ fn notmain() -> Result<i32, anyhow::Error> {
let mut rtt: Result<Rtt, probe_rs_rtt::Error>; let mut rtt: Result<Rtt, probe_rs_rtt::Error>;
loop { loop {
// TODO how do i best to this without allocating two rtts
rtt = Rtt::attach_region( rtt = Rtt::attach_region(
core.clone(), core.clone(),
&sess, &sess,
@ -207,28 +205,23 @@ fn notmain() -> Result<i32, anyhow::Error> {
// todo clean up control flow // todo clean up control flow
if rtt.is_ok() { if rtt.is_ok() {
log::info!("successfully attached rtt"); log::info!("Successfully attached RTT");
break; break;
} }
num_retries -= 1; num_retries -= 1;
if num_retries == 0 { if num_retries == 0 {
// todo return last err instead
break; break;
} }
log::info!("Rtt::attach_region failed. retrying."); log::info!("Attaching RTT failed. retrying");
} }
log::info!("go rtt");
let channel = rtt let channel = rtt
.unwrap() .unwrap() // using ? instead wouldn't show the user any helpful error message
.up_channels() .up_channels()
.take(0) .take(0)
.ok_or_else(|| anyhow!("RTT up channel 0 not found"))?; .ok_or_else(|| anyhow!("RTT up channel 0 not found"))?;
log::info!("chan");
static CONTINUE: AtomicBool = AtomicBool::new(true); static CONTINUE: AtomicBool = AtomicBool::new(true);
ctrlc::set_handler(|| { ctrlc::set_handler(|| {