Remove get_ from timer functions

This commit is contained in:
Gwilym Kuiper 2022-03-23 20:24:22 +00:00
parent c698f858bb
commit 8427bb5595
3 changed files with 8 additions and 8 deletions

View file

@ -25,10 +25,10 @@ fn main(mut gba: Gba) -> ! {
let mut frame_counter = 0i32; let mut frame_counter = 0i32;
loop { loop {
vblank_provider.wait_for_vblank(); vblank_provider.wait_for_vblank();
let before_mixing_cycles = timer.get_value(); let before_mixing_cycles = timer.value();
mixer.after_vblank(); mixer.after_vblank();
mixer.frame(); mixer.frame();
let after_mixing_cycles = timer.get_value(); let after_mixing_cycles = timer.value();
frame_counter = frame_counter.wrapping_add(1); frame_counter = frame_counter.wrapping_add(1);

View file

@ -375,7 +375,7 @@ pub fn profiler(timer: &mut crate::timer::Timer, period: u16) -> InterruptHandle
timer.set_overflow_amount(period); timer.set_overflow_amount(period);
timer.set_enabled(true); timer.set_enabled(true);
add_interrupt_handler(timer.get_interrupt(), |_key: &CriticalSection| { add_interrupt_handler(timer.interrupt(), |_key: &CriticalSection| {
crate::println!("{:#010x}", crate::get_program_counter_before_interrupt()); crate::println!("{:#010x}", crate::get_program_counter_before_interrupt());
}) })
} }

View file

@ -71,7 +71,7 @@ impl Timer {
self.data_register().set(count_up_value); self.data_register().set(count_up_value);
} }
pub fn get_value(&self) -> u16 { pub fn value(&self) -> u16 {
self.data_register().get() self.data_register().get()
} }
@ -96,18 +96,18 @@ impl Timer {
} }
fn data_register(&self) -> MemoryMapped<u16> { fn data_register(&self) -> MemoryMapped<u16> {
timer_data(self.get_timer_number()) timer_data(self.timer_number())
} }
fn control_register(&self) -> MemoryMapped<u16> { fn control_register(&self) -> MemoryMapped<u16> {
timer_control(self.get_timer_number()) timer_control(self.timer_number())
} }
fn get_timer_number(&self) -> usize { fn timer_number(&self) -> usize {
self.timer_number as usize self.timer_number as usize
} }
pub fn get_interrupt(&self) -> crate::interrupt::Interrupt { pub fn interrupt(&self) -> crate::interrupt::Interrupt {
use crate::interrupt::Interrupt; use crate::interrupt::Interrupt;
match self.timer_number { match self.timer_number {
0 => Interrupt::Timer0, 0 => Interrupt::Timer0,