clean up minor bugs and other issues

This commit is contained in:
bunnie 2021-04-06 22:38:11 +08:00
parent b9162fda3d
commit ca349ec1b0
9 changed files with 14 additions and 8 deletions

View file

@ -57,6 +57,8 @@ fn map_fonts() {
#[xous::xous_main] #[xous::xous_main]
fn xmain() -> ! { fn xmain() -> ! {
log_server::init_wait().unwrap(); log_server::init_wait().unwrap();
let debugtv = false;
log::set_max_level(log::LevelFilter::Info);
log::info!("my PID is {}", xous::process::id()); log::info!("my PID is {}", xous::process::id());
let xns = xous_names::XousNames::new().unwrap(); let xns = xous_names::XousNames::new().unwrap();
@ -89,7 +91,6 @@ fn xmain() -> ! {
let screen_clip = Rectangle::new(Point::new(0,0), display.screen_size()); let screen_clip = Rectangle::new(Point::new(0,0), display.screen_size());
let debugtv = false;
display.redraw(); display.redraw();
loop { loop {
let mut msg = xous::receive_message(sid).unwrap(); let mut msg = xous::receive_message(sid).unwrap();
@ -296,7 +297,7 @@ fn xmain() -> ! {
}; };
let mut ref_cursor = blitstr::Cursor::from_top_left_of(cr.into()); let mut ref_cursor = blitstr::Cursor::from_top_left_of(cr.into());
if debugtv { log::trace!("(TV): paint_str with {:?} | {:?} | {:?} | {:?}", cr, ref_cursor, tv.style, tv.text); } if debugtv { log::trace!("(TV): paint_str with {:?} | {:?} | {:?} | {:?} len: {}", cr, ref_cursor, tv.style, tv.text, tv.text.as_str().unwrap().len()); }
blitstr::paint_str( blitstr::paint_str(
display.native_buffer(), display.native_buffer(),
cr.into(), cr.into(),

View file

@ -560,6 +560,7 @@ impl InputTracker {
p_tv.ellipsis = true; p_tv.ellipsis = true;
p_tv.style = blitstr::GlyphStyle::Small; p_tv.style = blitstr::GlyphStyle::Small;
write!(p_tv.text, "{}", pred_str).expect("can't write the prediction string"); write!(p_tv.text, "{}", pred_str).expect("can't write the prediction string");
log::trace!("****posting string with length {}", p_tv.text.as_str().unwrap().len());
self.gam.post_textview(&mut p_tv).expect("couldn't post prediction text"); self.gam.post_textview(&mut p_tv).expect("couldn't post prediction text");
i += 1; i += 1;
} }
@ -600,7 +601,7 @@ fn xmain() -> ! {
let dbglistener = false; let dbglistener = false;
let dbgcanvas = false; let dbgcanvas = false;
log_server::init_wait().unwrap(); log_server::init_wait().unwrap();
log::set_max_level(log::LevelFilter::Trace); log::set_max_level(log::LevelFilter::Info);
info!("my PID is {}", xous::process::id()); info!("my PID is {}", xous::process::id());
let xns = xous_names::XousNames::new().unwrap(); let xns = xous_names::XousNames::new().unwrap();

View file

@ -13,6 +13,7 @@ use num_traits::FromPrimitive;
#[xous::xous_main] #[xous::xous_main]
fn xmain() -> ! { fn xmain() -> ! {
log_server::init_wait().unwrap(); log_server::init_wait().unwrap();
log::set_max_level(log::LevelFilter::Info);
info!("my PID is {}", xous::process::id()); info!("my PID is {}", xous::process::id());
let xns = xous_names::XousNames::new().unwrap(); let xns = xous_names::XousNames::new().unwrap();
@ -56,7 +57,7 @@ fn xmain() -> ! {
// the API allows for large picked feedback, but this implementation only keeps the first 64 characters // the API allows for large picked feedback, but this implementation only keeps the first 64 characters
let mut local_s: String<64> = String::new(); let mut local_s: String<64> = String::new();
use core::fmt::Write; use core::fmt::Write;
write!(local_s, "{:32}", s.as_str()).expect("overflowed history variable"); write!(local_s, "{}", s.as_str()).expect("overflowed history variable");
log::trace!("storing history value | {}", s.as_str()); log::trace!("storing history value | {}", s.as_str());
if history.len() == history_max { if history.len() == history_max {
history.dequeue().expect("couldn't dequeue history"); history.dequeue().expect("couldn't dequeue history");

View file

@ -450,7 +450,7 @@ fn xmain() -> ! {
let gpio_base = crate::implementation::log_init(); let gpio_base = crate::implementation::log_init();
log_server::init_wait().unwrap(); log_server::init_wait().unwrap();
log::set_max_level(log::LevelFilter::Trace); log::set_max_level(log::LevelFilter::Info);
info!("my PID is {}", xous::process::id()); info!("my PID is {}", xous::process::id());
let xns = xous_names::XousNames::new().unwrap(); let xns = xous_names::XousNames::new().unwrap();

View file

@ -237,7 +237,7 @@ pub(crate) const SERVER_NAME_SHELLCHAT: &str = "_Shell chat application_";
#[xous::xous_main] #[xous::xous_main]
fn xmain() -> ! { fn xmain() -> ! {
log_server::init_wait().unwrap(); log_server::init_wait().unwrap();
log::set_max_level(log::LevelFilter::Trace); log::set_max_level(log::LevelFilter::Info);
info!("my PID is {}", xous::process::id()); info!("my PID is {}", xous::process::id());
let xns = xous_names::XousNames::new().unwrap(); let xns = xous_names::XousNames::new().unwrap();

View file

@ -22,6 +22,6 @@ utralib = {path = "../../utralib"}
debug-print = [] debug-print = []
watchdog = [] watchdog = []
# generally you want to disable watchdog if you're doing development. # generally you want to disable watchdog if you're doing development.
#default = ["watchdog"] default = ["watchdog"]
default = [] #default = []
# default = ["debug-print"] # default = ["debug-print"]

View file

@ -431,6 +431,7 @@ fn xmain() -> ! {
let mut sleep_heap: BinaryHeap<SleepRequest, U32, Min> = BinaryHeap::new(); let mut sleep_heap: BinaryHeap<SleepRequest, U32, Min> = BinaryHeap::new();
log_server::init_wait().unwrap(); log_server::init_wait().unwrap();
log::set_max_level(log::LevelFilter::Info);
info!("my PID is {}", xous::process::id()); info!("my PID is {}", xous::process::id());
let ticktimer_server = xous::create_server_with_address(b"ticktimer-server") let ticktimer_server = xous::create_server_with_address(b"ticktimer-server")

View file

@ -150,6 +150,7 @@ fn xmain() -> ! {
use crate::implementation::Trng; use crate::implementation::Trng;
log_server::init_wait().unwrap(); log_server::init_wait().unwrap();
log::set_max_level(log::LevelFilter::Info);
info!("my PID is {}", xous::process::id()); info!("my PID is {}", xous::process::id());
let xns = xous_names::XousNames::new().unwrap(); let xns = xous_names::XousNames::new().unwrap();

View file

@ -22,6 +22,7 @@ const FAIL_TIMEOUT_MS: u64 = 100;
fn xmain() -> ! { fn xmain() -> ! {
let debug1 = false; let debug1 = false;
log_server::init_wait().unwrap(); log_server::init_wait().unwrap();
log::set_max_level(log::LevelFilter::Info);
info!("my PID is {}", xous::process::id()); info!("my PID is {}", xous::process::id());
let name_server = xous::create_server_with_address(b"xous-name-server") let name_server = xous::create_server_with_address(b"xous-name-server")