summaryrefslogtreecommitdiff
path: root/arm9/source/devices/clock.h
diff options
context:
space:
mode:
authorBen Bridle <ben@derelict.engineering>2024-11-22 16:01:31 +1300
committerBen Bridle <ben@derelict.engineering>2024-11-22 16:07:48 +1300
commite05888d141bc64e92d81859af0d87627e6fbc477 (patch)
tree8d4008de05045c5721cfa6ba49aa4c39cb12cf2f /arm9/source/devices/clock.h
parent2acaa6cb6c54c246b7f152f91d0428325c5b3ebd (diff)
downloadbedrock-nds-e05888d141bc64e92d81859af0d87627e6fbc477.zip
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.
Diffstat (limited to 'arm9/source/devices/clock.h')
-rw-r--r--arm9/source/devices/clock.h25
1 files changed, 7 insertions, 18 deletions
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 <time.h>
+
#ifndef CLOCK_H_
#define CLOCK_H_
- #include <time.h>
-
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