Skip to content

Commit

Permalink
lcd 0.5
Browse files Browse the repository at this point in the history
  • Loading branch information
buhe committed Oct 28, 2021
1 parent 5b70788 commit 0239949
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions os/src/driver/lcd/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ mod cp437;
mod cp437_8x8;
// 用 LCD 输出
mod console;

static mut image: ScreenImage = [0; DISP_PIXELS / 2];
pub fn init() {

DRIVER.lock();
Expand Down Expand Up @@ -91,9 +91,10 @@ lazy_static!{
}

pub fn print_with_lcd(args: fmt::Arguments){
let mut image: ScreenImage = [0; DISP_PIXELS / 2];

CONSOLE.lock().write_fmt(args).unwrap();

unsafe{
CONSOLE.lock().render(&mut image);// render 会导致不执行 task
DRIVER.lock().flush(&image);
}
}

0 comments on commit 0239949

Please sign in to comment.