From 8427bb559587ecd4b99e8eee3a1074164e92f983 Mon Sep 17 00:00:00 2001 From: Gwilym Kuiper Date: Wed, 23 Mar 2022 20:24:22 +0000 Subject: [PATCH] Remove get_ from timer functions --- agb/examples/stereo_sound.rs | 4 ++-- agb/src/interrupt.rs | 2 +- agb/src/timer.rs | 10 +++++----- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/agb/examples/stereo_sound.rs b/agb/examples/stereo_sound.rs index 7807673c..a1bf1f07 100644 --- a/agb/examples/stereo_sound.rs +++ b/agb/examples/stereo_sound.rs @@ -25,10 +25,10 @@ fn main(mut gba: Gba) -> ! { let mut frame_counter = 0i32; loop { vblank_provider.wait_for_vblank(); - let before_mixing_cycles = timer.get_value(); + let before_mixing_cycles = timer.value(); mixer.after_vblank(); mixer.frame(); - let after_mixing_cycles = timer.get_value(); + let after_mixing_cycles = timer.value(); frame_counter = frame_counter.wrapping_add(1); diff --git a/agb/src/interrupt.rs b/agb/src/interrupt.rs index 111e777f..0d660860 100644 --- a/agb/src/interrupt.rs +++ b/agb/src/interrupt.rs @@ -375,7 +375,7 @@ pub fn profiler(timer: &mut crate::timer::Timer, period: u16) -> InterruptHandle timer.set_overflow_amount(period); 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()); }) } diff --git a/agb/src/timer.rs b/agb/src/timer.rs index 75befee8..8f301416 100644 --- a/agb/src/timer.rs +++ b/agb/src/timer.rs @@ -71,7 +71,7 @@ impl Timer { self.data_register().set(count_up_value); } - pub fn get_value(&self) -> u16 { + pub fn value(&self) -> u16 { self.data_register().get() } @@ -96,18 +96,18 @@ impl Timer { } fn data_register(&self) -> MemoryMapped { - timer_data(self.get_timer_number()) + timer_data(self.timer_number()) } fn control_register(&self) -> MemoryMapped { - 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 } - pub fn get_interrupt(&self) -> crate::interrupt::Interrupt { + pub fn interrupt(&self) -> crate::interrupt::Interrupt { use crate::interrupt::Interrupt; match self.timer_number { 0 => Interrupt::Timer0,