From d65fd5d7405ad67dc1f4d126b6df80efaaef30ea Mon Sep 17 00:00:00 2001 From: Gwilym Kuiper Date: Sat, 11 Jun 2022 16:22:28 +0100 Subject: [PATCH] Don't require the 32kHz frequency for interrupts --- agb/src/sound/mixer/sw_mixer.rs | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/agb/src/sound/mixer/sw_mixer.rs b/agb/src/sound/mixer/sw_mixer.rs index f1a2b8bb..fd28e4bb 100644 --- a/agb/src/sound/mixer/sw_mixer.rs +++ b/agb/src/sound/mixer/sw_mixer.rs @@ -5,9 +5,13 @@ use bare_metal::{CriticalSection, Mutex}; use super::hw; use super::hw::LeftOrRight; use super::{SoundChannel, SoundPriority}; -use crate::fixnum::Num; -use crate::interrupt::{add_interrupt_handler, free, Interrupt, InterruptHandler}; -use crate::timer::{Divider, Timer}; +use crate::{ + fixnum::Num, + interrupt::free, + interrupt::{add_interrupt_handler, Interrupt, InterruptHandler}, + timer::Divider, + timer::Timer, +}; // Defined in mixer.s extern "C" { @@ -55,7 +59,8 @@ impl Mixer { 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<'_> { let mut timer1 = unsafe { Timer::new(1) }; timer1.set_cascade(true);