another intermediate commit

This commit is contained in:
bunnie 2021-03-02 21:15:40 +08:00
parent 96a19baa8d
commit 4b0f50293f
4 changed files with 11 additions and 10 deletions

View file

@ -789,7 +789,7 @@ impl SystemServices {
) -> Result<TID, xous_kernel::Error> {
let previous_pid = self.current_pid();
let debug = false;
let debug = true;
if debug {
println!(
"\n\r KERNEL({},{}): Activating process {} thread {}",
@ -820,10 +820,10 @@ impl SystemServices {
new.state
);
if new_tid == 0 {
// print!(
// "PID {}: Looking for a valid context in the mask {:08b}, curent context {} ({:08b})",
// new_pid, x, new.current_context, new.current_context
// );
print!(
"PID {}: Looking for a valid context in the mask {:08b}",
new_pid, x,
);
//new_tid = 0;
new_tid = new.current_thread as usize;
while x & (1 << new_tid) == 0 {
@ -837,7 +837,7 @@ impl SystemServices {
}
}
new.current_thread = new_tid as _;
// println!(" -- picked thread {}", new_tid);
println!(" -- picked thread {}", new_tid);
} else if x & (1 << new_tid) == 0 {
println!(
"thread is {:?}, which is not valid for new thread {}",

View file

@ -145,7 +145,7 @@ fn xmain() -> ! {
let maybe_env = xous::try_receive_message(gam_sid).unwrap();
match maybe_env {
Some(envelope) => { // */
let envelope = xous::receive_message(gam_sid).unwrap();
// let envelope = xous::receive_message(gam_sid).unwrap();
if debug1 {info!("GAM: Message: {:?}", envelope); }
if let Ok(opcode) = Opcode::try_from(&envelope.body) {
if debug1 {info!("GAM: Opcode: {:?}", opcode);}

View file

@ -49,7 +49,6 @@ pub fn status_thread(canvas_gid: [u32; 4]) {
let mut stats: BattStats = BattStats::default();
let mut last_time: u64 = ticktimer_server::elapsed_ms(ticktimer_conn).unwrap();
let mut stats_phase: usize = 0;
info!("GAM|status: starting main loop");
let style_dark = DrawStyle::new(PixelColor::Dark, PixelColor::Dark, 1);
gam::draw_line(gam_conn, status_gid, Line::new_with_style(
@ -58,6 +57,8 @@ pub fn status_thread(canvas_gid: [u32; 4]) {
style_dark
)).expect("GAM|status: Can't draw border line");
com::request_battstat_events(xous::names::SERVER_NAME_STATUS, com_conn).expect("GAM|status: couldn't request events from COM");
info!("GAM|status: starting main loop");
loop {
/*
if debug1{info!("GAM|status: periodic tasks: updating uptime, requesting battstats");}
@ -72,7 +73,7 @@ pub fn status_thread(canvas_gid: [u32; 4]) {
let maybe_env = xous::try_receive_message(status_sid).unwrap();
match maybe_env {
Some(envelope) => {
let envelope = xous::receive_message(status_sid).unwrap();
//let envelope = xous::receive_message(status_sid).unwrap();
if debug1{info!("GAM|status: Message: {:?}", envelope);}
if let Ok(opcode) = com::api::Opcode::try_from(&envelope.body) {
match opcode {

View file

@ -325,7 +325,7 @@ fn some_main() -> ! {
)
.expect("couldn't map GPIO CSR range");
let mut gpio = CSR::new(gpio_base.as_mut_ptr() as *mut u32);
gpio.wfo(utra::gpio::UARTSEL_UARTSEL, 1); // 0 = kernel, 1 = log, 2 = app_uart
gpio.wfo(utra::gpio::UARTSEL_UARTSEL, 0); // 0 = kernel, 1 = log, 2 = app_uart
}
let mut output = implementation::init();