mirror of
https://github.com/italicsjenga/agb.git
synced 2024-12-24 08:41:34 +11:00
Don't require the 32kHz frequency for interrupts
This commit is contained in:
parent
3bd85c7d7c
commit
d65fd5d740
|
@ -5,9 +5,13 @@ use bare_metal::{CriticalSection, Mutex};
|
||||||
use super::hw;
|
use super::hw;
|
||||||
use super::hw::LeftOrRight;
|
use super::hw::LeftOrRight;
|
||||||
use super::{SoundChannel, SoundPriority};
|
use super::{SoundChannel, SoundPriority};
|
||||||
use crate::fixnum::Num;
|
use crate::{
|
||||||
use crate::interrupt::{add_interrupt_handler, free, Interrupt, InterruptHandler};
|
fixnum::Num,
|
||||||
use crate::timer::{Divider, Timer};
|
interrupt::free,
|
||||||
|
interrupt::{add_interrupt_handler, Interrupt, InterruptHandler},
|
||||||
|
timer::Divider,
|
||||||
|
timer::Timer,
|
||||||
|
};
|
||||||
|
|
||||||
// Defined in mixer.s
|
// Defined in mixer.s
|
||||||
extern "C" {
|
extern "C" {
|
||||||
|
@ -55,7 +59,8 @@ impl Mixer {
|
||||||
free(|cs| self.buffer.swap(cs));
|
free(|cs| self.buffer.swap(cs));
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(feature = "freq32768")]
|
/// Note that if you set up an interrupt handler, you should not call `after_vblank` any more
|
||||||
|
/// You are still required to call `frame`
|
||||||
pub fn setup_interrupt_handler(&self) -> InterruptHandler<'_> {
|
pub fn setup_interrupt_handler(&self) -> InterruptHandler<'_> {
|
||||||
let mut timer1 = unsafe { Timer::new(1) };
|
let mut timer1 = unsafe { Timer::new(1) };
|
||||||
timer1.set_cascade(true);
|
timer1.set_cascade(true);
|
||||||
|
|
Loading…
Reference in a new issue