From e05888d141bc64e92d81859af0d87627e6fbc477 Mon Sep 17 00:00:00 2001 From: Ben Bridle Date: Fri, 22 Nov 2024 16:01:31 +1300 Subject: Simplify clock device implementation Two pairs of generic get/set functions now do the role of the previous pair of custom get/set functions for each timer. --- arm9/source/devices/clock.h | 25 +++++++------------------ 1 file changed, 7 insertions(+), 18 deletions(-) (limited to 'arm9/source/devices/clock.h') diff --git a/arm9/source/devices/clock.h b/arm9/source/devices/clock.h index 892479f..04c4d5d 100644 --- a/arm9/source/devices/clock.h +++ b/arm9/source/devices/clock.h @@ -1,8 +1,8 @@ +#include + #ifndef CLOCK_H_ #define CLOCK_H_ - #include - typedef struct { u32 end; // real end time u16 read, write; // read write caches @@ -27,20 +27,9 @@ bool check_timers(ClockDevice *clk); - u8 get_timer1_high(ClockDevice *clock); - u8 get_timer1_low( ClockDevice *clock); - u8 get_timer2_high(ClockDevice *clock); - u8 get_timer2_low( ClockDevice *clock); - u8 get_timer3_high(ClockDevice *clock); - u8 get_timer3_low( ClockDevice *clock); - u8 get_timer4_high(ClockDevice *clock); - u8 get_timer4_low( ClockDevice *clock); - void set_timer1_high(ClockDevice *clock, u8 high); - void set_timer1_low( ClockDevice *clock, u8 low); - void set_timer2_high(ClockDevice *clock, u8 high); - void set_timer2_low( ClockDevice *clock, u8 low); - void set_timer3_high(ClockDevice *clock, u8 high); - void set_timer3_low( ClockDevice *clock, u8 low); - void set_timer4_high(ClockDevice *clock, u8 high); - void set_timer4_low( ClockDevice *clock, u8 low); + u8 get_timer_high(ClockTimer *t); + u8 get_timer_low( ClockTimer *t); + void set_timer_high(ClockTimer *t, u8 high); + void set_timer_low( ClockTimer *t, u8 low); + #endif -- cgit v1.2.3-70-g09d2