mirror of
https://github.com/italicsjenga/gba.git
synced 2024-12-25 03:31:36 +11:00
d15168068b
The hello_magic example does not depend on the gba crate, but the crt0 now assumes that the symbol for the interrupt handler which is defined in it will be present, as interrupts ought to be handled in some manner. If neither the symbol or the crate are added then the linker will give an error, but if anything in the gba crate is used also then the symbol will be brought in, so defining it manually also would cause a duplicate definition error. In the future something like cortex-m-rt's `exception!` macro could be used to better document how to define this symbol (all their examples depend on at least one symbol from their runtime library, so they don't have this problem).
24 lines
585 B
Rust
24 lines
585 B
Rust
#![no_std]
|
|
#![feature(start)]
|
|
|
|
#[panic_handler]
|
|
fn panic(_info: &core::panic::PanicInfo) -> ! {
|
|
loop {}
|
|
}
|
|
|
|
#[start]
|
|
fn main(_argc: isize, _argv: *const *const u8) -> isize {
|
|
unsafe {
|
|
(0x400_0000 as *mut u16).write_volatile(0x0403);
|
|
(0x600_0000 as *mut u16).offset(120 + 80 * 240).write_volatile(0x001F);
|
|
(0x600_0000 as *mut u16).offset(136 + 80 * 240).write_volatile(0x03E0);
|
|
(0x600_0000 as *mut u16).offset(120 + 96 * 240).write_volatile(0x7C00);
|
|
loop {}
|
|
}
|
|
}
|
|
|
|
#[no_mangle]
|
|
static __IRQ_HANDLER: extern "C" fn() = irq_handler;
|
|
|
|
extern "C" fn irq_handler() {}
|