From e62256b3df9d3f2771d7e0a303d23ace87e304b1 Mon Sep 17 00:00:00 2001 From: bunnie Date: Wed, 3 Mar 2021 22:50:46 +0800 Subject: [PATCH] clean up hosted mode warnings --- kernel/src/debug.rs | 1 + kernel/src/services.rs | 2 +- services/com/src/main.rs | 5 ++--- services/keyboard/src/main.rs | 7 +++++-- services/trng/src/main.rs | 4 ++-- xtask/src/main.rs | 4 ++-- 6 files changed, 13 insertions(+), 10 deletions(-) diff --git a/kernel/src/debug.rs b/kernel/src/debug.rs index 4a27e97a0..8b2c1f463 100644 --- a/kernel/src/debug.rs +++ b/kernel/src/debug.rs @@ -6,6 +6,7 @@ use core::fmt::{Error, Write}; #[cfg(baremetal)] use utralib::generated::*; +#[allow(dead_code)] // this is unused in hosted mode, kill the warning static mut INITIALIZED: bool = false; #[macro_use] diff --git a/kernel/src/services.rs b/kernel/src/services.rs index e23d4b702..d56cabcd3 100644 --- a/kernel/src/services.rs +++ b/kernel/src/services.rs @@ -816,7 +816,7 @@ impl SystemServices { "\n\r KERNEL({},{}): Activating process {} thread {}", previous_pid, previous_tid, new_pid, new_tid ); - ArchProcess::with_current(|current| current.print_thread()); + //ArchProcess::with_current(|current| current.print_thread()); } // Save state if the PID has changed. This will activate the new memory diff --git a/services/com/src/main.rs b/services/com/src/main.rs index 00c0f3e33..607f8ba34 100644 --- a/services/com/src/main.rs +++ b/services/com/src/main.rs @@ -178,9 +178,8 @@ mod implementation { use crate::WorkRequest; use com_rs_ref as com_rs; use com_rs::*; - use log::{error, info}; + use log::error; - #[macro_use] use heapless::Vec; use heapless::consts::*; @@ -201,7 +200,7 @@ mod implementation { 0xDEAD as u16 } - pub fn wait_txrx(&mut self, tx: u16, timeout: Option) -> u16 { + pub fn wait_txrx(&mut self, _tx: u16, _timeout: Option) -> u16 { 0xDEAD as u16 } diff --git a/services/keyboard/src/main.rs b/services/keyboard/src/main.rs index 2effb1b85..1ce4a3b4d 100644 --- a/services/keyboard/src/main.rs +++ b/services/keyboard/src/main.rs @@ -19,6 +19,7 @@ use xous::buffer; use rkyv::{archived_value, Write}; /// Compute the dvorak key mapping of row/col to key tuples +#[allow(dead_code)] fn map_dvorak(code: RowCol) -> ScanCode { let rc = (code.r, code.c); @@ -93,6 +94,7 @@ fn map_dvorak(code: RowCol) -> ScanCode { /// Compute the dvorak key mapping of row/col to key tuples +#[allow(dead_code)] fn map_qwerty(code: RowCol) -> ScanCode { let rc = (code.r, code.c); @@ -743,9 +745,10 @@ mod implementation { use heapless::Vec; use heapless::consts::*; use crate::api::*; - use crate::{map_dvorak, map_qwerty}; - use log::{error, info}; + //use crate::{map_dvorak, map_qwerty}; + //use log::{error, info}; + #[allow(dead_code)] pub struct Keyboard { map: KeyMap, rate: u32, diff --git a/services/trng/src/main.rs b/services/trng/src/main.rs index 7c8401e34..91d65bb0b 100644 --- a/services/trng/src/main.rs +++ b/services/trng/src/main.rs @@ -110,8 +110,7 @@ mod implementation { // a stub to try to avoid breaking hosted mode for as long as possible. #[cfg(not(target_os = "none"))] mod implementation { - use crate::api::*; - use log::{error, info}; + use log::info; pub struct Trng { seed: u32, @@ -131,6 +130,7 @@ mod implementation { lfsr } + #[allow(dead_code)] pub fn wait_full(&self) { } pub fn get_trng(&mut self, _count: usize) -> [u32; 2] { diff --git a/xtask/src/main.rs b/xtask/src/main.rs index 7ef2133a6..c92bf1509 100644 --- a/xtask/src/main.rs +++ b/xtask/src/main.rs @@ -192,8 +192,8 @@ fn run(debug: bool) -> Result<(), DynError> { let init = [ //"shell", "gam", - "ime-frontend", - "ime-plugin-shell", + //"ime-frontend", + //"ime-plugin-shell", //"benchmark", //"benchmark-target", "log-server",