From ca30fac18beb9e49097f2d693281a499937614e1 Mon Sep 17 00:00:00 2001 From: Yifan Wu Date: Wed, 29 Mar 2023 22:45:49 +0800 Subject: [PATCH] fix ch9 && remove some warnings --- os/src/sbi.rs | 12 ------------ os/src/task/mod.rs | 1 - user/src/bin/gui_rect.rs | 4 ++-- 3 files changed, 2 insertions(+), 15 deletions(-) diff --git a/os/src/sbi.rs b/os/src/sbi.rs index 326f4d63..2c0aaa51 100644 --- a/os/src/sbi.rs +++ b/os/src/sbi.rs @@ -1,15 +1,3 @@ -/// use sbi call to putchar in console (qemu uart handler) -pub fn console_putchar(c: usize) { - #[allow(deprecated)] - sbi_rt::legacy::console_putchar(c); -} - -/// use sbi call to getchar from console (qemu uart handler) -pub fn console_getchar() -> usize { - #[allow(deprecated)] - sbi_rt::legacy::console_getchar() -} - /// use sbi call to set timer pub fn set_timer(timer: usize) { sbi_rt::set_timer(timer as _); diff --git a/os/src/task/mod.rs b/os/src/task/mod.rs index de611f35..a8b9b7b4 100644 --- a/os/src/task/mod.rs +++ b/os/src/task/mod.rs @@ -57,7 +57,6 @@ pub fn block_current_and_run_next() { let task_cx_ptr = block_current_task(); schedule(task_cx_ptr); } -use crate::board::QEMUExit; /// Exit the current 'Running' task and run the next task in task list. pub fn exit_current_and_run_next(exit_code: i32) { diff --git a/user/src/bin/gui_rect.rs b/user/src/bin/gui_rect.rs index a459dbc3..b7af3ee7 100644 --- a/user/src/bin/gui_rect.rs +++ b/user/src/bin/gui_rect.rs @@ -58,8 +58,8 @@ impl DrawingBoard { pub fn main() -> i32 { let mut board = DrawingBoard::new(); let _ = board.disp.clear(Rgb888::BLACK).unwrap(); - for i in 0..5 { - board.latest_pos.x += (RECT_SIZE as i32 + 20); + for _ in 0..5 { + board.latest_pos.x += RECT_SIZE as i32 + 20; //board.latest_pos.y += i; board.paint(); }