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-rtt",
"rustc-demangle",
"thiserror",
"xmas-elf",
]

View file

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

View file

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