|
|
|
@ -1,8 +1,8 @@
|
|
|
|
|
#![no_std]
|
|
|
|
|
#![no_main]
|
|
|
|
|
|
|
|
|
|
use core::panic::PanicInfo;
|
|
|
|
|
use lwcpu::{self, NumberDisplay, Screen, TextDisplay};
|
|
|
|
|
use core::{fmt::Write, panic::PanicInfo};
|
|
|
|
|
use lwcpu::{NumberDisplay, Screen, TextDisplay};
|
|
|
|
|
use riscv_rt::entry;
|
|
|
|
|
|
|
|
|
|
#[panic_handler]
|
|
|
|
@ -11,16 +11,15 @@ fn panic_handler(_info: &PanicInfo) -> ! {
|
|
|
|
|
loop {}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const HELLO_WORLD: &[u8; 13] = b" Hello world!";
|
|
|
|
|
const HELLO_WORLD: &str = " Hello world!";
|
|
|
|
|
|
|
|
|
|
#[entry]
|
|
|
|
|
fn main() -> ! {
|
|
|
|
|
let mut text = TextDisplay{};
|
|
|
|
|
for i in 0..31 {
|
|
|
|
|
Screen::set_line(i, 1 << i);
|
|
|
|
|
}
|
|
|
|
|
loop {
|
|
|
|
|
for ch in HELLO_WORLD {
|
|
|
|
|
TextDisplay::put_char(*ch);
|
|
|
|
|
}
|
|
|
|
|
let _ = text.write_str(HELLO_WORLD);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|