mirror of
https://github.com/italicsjenga/agb.git
synced 2025-01-11 17:41:33 +11:00
add docs for vblank interrupt
This commit is contained in:
parent
fa250cee60
commit
477b0465fb
|
@ -391,10 +391,14 @@ impl<'a, T> DerefMut for MutexRef<'a, T> {
|
|||
pub struct VBlank {}
|
||||
|
||||
impl VBlank {
|
||||
/// Handles setting up everything reqired to be able to use the wait for
|
||||
/// interrupt syscall.
|
||||
pub fn get() -> Self {
|
||||
interrupt_to_root(Interrupt::VBlank).add();
|
||||
VBlank {}
|
||||
}
|
||||
/// Pauses CPU until vblank interrupt is triggered where code execution is
|
||||
/// resumed.
|
||||
pub fn wait_for_vblank(&self) {
|
||||
crate::syscall::wait_for_vblank();
|
||||
}
|
||||
|
|
|
@ -39,6 +39,8 @@ pub fn wait_for_interrupt() {
|
|||
}
|
||||
}
|
||||
|
||||
/// The vblank interrupt handler [VBlank][crate::interrupt::VBlank] should be
|
||||
/// used instead of calling this function directly.
|
||||
pub fn wait_for_vblank() {
|
||||
unsafe {
|
||||
asm!(
|
||||
|
|
Loading…
Reference in a new issue