From 2f08757512dc9a57c66226ccbc56852598917c14 Mon Sep 17 00:00:00 2001 From: Egor Ananyin Date: Wed, 24 Jun 2020 20:31:49 +0300 Subject: Shared things --- arm9/lib/include/OS_timer.h | 28 +--------------------------- 1 file changed, 1 insertion(+), 27 deletions(-) (limited to 'arm9/lib/include') diff --git a/arm9/lib/include/OS_timer.h b/arm9/lib/include/OS_timer.h index 8b2a97a9..effa5fc0 100644 --- a/arm9/lib/include/OS_timer.h +++ b/arm9/lib/include/OS_timer.h @@ -1,32 +1,6 @@ #ifndef POKEDIAMOND_OS_TIMER_H #define POKEDIAMOND_OS_TIMER_H -#include "consts.h" - -typedef enum -{ - OS_TIMER_PRESCALER_1 = (0UL << REG_OS_TM0CNT_H_PS_SHIFT), - OS_TIMER_PRESCALER_64 = (1UL << REG_OS_TM0CNT_H_PS_SHIFT), - OS_TIMER_PRESCALER_256 = (2UL << REG_OS_TM0CNT_H_PS_SHIFT), - OS_TIMER_PRESCALER_1024 = (3UL << REG_OS_TM0CNT_H_PS_SHIFT) -} OSTimerPrescaler; - -typedef enum -{ - OS_TIMER_0 = 0, - OS_TIMER_1 = 1, - OS_TIMER_2 = 2, - OS_TIMER_3 = 3 -} OSTimer; - -static inline void OS_SetTimerCount(OSTimer id, u16 count) -{ - *((REGType16 *)((u32)®_OS_TM0CNT_L + id * 4)) = count; -} - -static inline void OS_SetTimerControl(OSTimer id, u16 control) -{ - *((REGType16 *)((u32)®_OS_TM0CNT_H + id * 4)) = control; -} +#include "nitro/OS_timer_shared.h" #endif //POKEDIAMOND_OS_TIMER_H -- cgit v1.2.3 From e34791ca4a781fc37717ac0ea7c2ac9fd5d65c2e Mon Sep 17 00:00:00 2001 From: Egor Ananyin Date: Wed, 24 Jun 2020 20:40:02 +0300 Subject: Remove duplicates --- arm9/lib/include/registers.h | 10 ---------- 1 file changed, 10 deletions(-) (limited to 'arm9/lib/include') diff --git a/arm9/lib/include/registers.h b/arm9/lib/include/registers.h index a5355322..75046308 100644 --- a/arm9/lib/include/registers.h +++ b/arm9/lib/include/registers.h @@ -73,15 +73,6 @@ #define reg_MI_DMA2_CLR_DATA (*(REGType32v *)0x40000e8) #define reg_MI_DMA3_CLR_DATA (*(REGType32v *)0x40000ec) -#define reg_OS_TM0CNT_L (*(REGType16v *)0x4000100) -#define reg_OS_TM0CNT_H (*(REGType16v *)0x4000102) -#define reg_OS_TM1CNT_L (*(REGType16v *)0x4000104) -#define reg_OS_TM1CNT_H (*(REGType16v *)0x4000106) -#define reg_OS_TM2CNT_L (*(REGType16v *)0x4000108) -#define reg_OS_TM2CNT_H (*(REGType16v *)0x400010a) -#define reg_OS_TM3CNT_L (*(REGType16v *)0x400010c) -#define reg_OS_TM3CNT_H (*(REGType16v *)0x400010e) - #define reg_EXI_SIODATA32 (*(REGType32v *)0x4000120) #define reg_EXI_SIOCNT (*(REGType16v *)0x4000128) #define reg_EXI_SIOSEL (*(REGType32v *)0x400012c) @@ -354,7 +345,6 @@ #define reg_MI_MCD1 (*(REGType32v *)0x4100010) #define reg_CARD_DATA (*(REGType32v *)0x4100010) //? -#define REG_OS_TM0CNT_H_PS_SHIFT 0 #define REG_OS_IE_T0_SHIFT 3 #define REG_OS_TM0CNT_H_I_MASK 0x0040 -- cgit v1.2.3