|
|
|
@ -14,20 +14,27 @@ fn panic_handler(_info: &PanicInfo) -> ! {
|
|
|
|
|
|
|
|
|
|
const OUTPUT: *mut u32 = 0x2000_0000 as *mut u32;
|
|
|
|
|
const BTNS: *mut u8 = 0x2000_0008 as *mut u8;
|
|
|
|
|
const TEXT: *mut u32 = 0x2000_000C as *mut u32;
|
|
|
|
|
const SCREEN: *mut u32 = 0x2000_0080 as *mut u32;
|
|
|
|
|
|
|
|
|
|
const HELLO_WORLD: &[u8; 13] = b" Hello world!";
|
|
|
|
|
|
|
|
|
|
#[entry]
|
|
|
|
|
fn main() -> ! {
|
|
|
|
|
loop {
|
|
|
|
|
unsafe {
|
|
|
|
|
SCREEN.write_volatile(0b101);
|
|
|
|
|
}
|
|
|
|
|
for i in 0..31 {
|
|
|
|
|
unsafe {
|
|
|
|
|
SCREEN.write_volatile(0b101);
|
|
|
|
|
let mut x = SCREEN.offset(i).read_volatile();
|
|
|
|
|
x <<= 1;
|
|
|
|
|
SCREEN.offset(i + 1).write_volatile(x);
|
|
|
|
|
}
|
|
|
|
|
for i in 0..31 {
|
|
|
|
|
unsafe {
|
|
|
|
|
let mut x = SCREEN.offset(i).read_volatile();
|
|
|
|
|
x <<= 1;
|
|
|
|
|
SCREEN.offset(i+1).write_volatile(x);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
for ch in HELLO_WORLD {
|
|
|
|
|
unsafe {
|
|
|
|
|
TEXT.write_volatile(*ch as u32);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
loop {}
|
|
|
|
|
}
|
|
|
|
|