mirror of
https://github.com/italicsjenga/agb.git
synced 2024-12-24 08:41:34 +11:00
print in interrupt
This commit is contained in:
parent
477b0465fb
commit
ff51341679
|
@ -4,14 +4,11 @@
|
||||||
extern crate agb;
|
extern crate agb;
|
||||||
#[no_mangle]
|
#[no_mangle]
|
||||||
pub fn main() -> ! {
|
pub fn main() -> ! {
|
||||||
let vblank = agb::interrupt::VBlank::get();
|
let count = agb::interrupt::Mutex::new(0);
|
||||||
|
agb::add_interrupt_handler!(agb::interrupt::Interrupt::VBlank, |key| {
|
||||||
let mut count = 0;
|
let mut count = count.lock_with_key(&key);
|
||||||
loop {
|
agb::println!("Hello, world, frame = {}", *count);
|
||||||
vblank.wait_for_vblank();
|
*count += 1;
|
||||||
|
});
|
||||||
agb::println!("Hello, world, frame = {}", count);
|
loop {}
|
||||||
|
|
||||||
count += 1;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue