diff options
author | red031000 <rubenru09@aol.com> | 2020-05-11 21:59:38 +0100 |
---|---|---|
committer | red031000 <rubenru09@aol.com> | 2020-05-11 21:59:38 +0100 |
commit | a2ab3a44f5a44ef2de486c56ee47c4022b8395f0 (patch) | |
tree | 650ee16906300c62e39da28c962b628daa7bdc27 /arm9/lib/src | |
parent | 4a8f611094056abe4fa53a824c4100f71773abf5 (diff) |
OSi_EnterTimerCallback and some more registers
Diffstat (limited to 'arm9/lib/src')
-rw-r--r-- | arm9/lib/src/FX_cp.c | 8 | ||||
-rw-r--r-- | arm9/lib/src/OS_interrupt.c | 10 |
2 files changed, 14 insertions, 4 deletions
diff --git a/arm9/lib/src/FX_cp.c b/arm9/lib/src/FX_cp.c index 08443dc8..0c03f673 100644 --- a/arm9/lib/src/FX_cp.c +++ b/arm9/lib/src/FX_cp.c @@ -55,16 +55,16 @@ ARM_FUNC void FX_DivAsync(fx32 numerator, fx32 denominator){ ARM_FUNC fx32 FX_DivS32(fx32 numerator, fx32 denominator){ reg_CP_DIVCNT = 0x0; - *(REGType32 *)REG_DIV_NUMER_ADDR = (u32)numerator; //32bit write for some reason + *(REGType32 *)®_CP_DIV_NUMER = (u32)numerator; //32bit write for some reason reg_CP_DIV_DENOM = (u32)denominator; while (reg_CP_DIVCNT & 0x8000); - return *(REGType32 *)REG_DIV_RESULT_ADDR; + return *(REGType32 *)®_CP_DIV_RESULT; } ARM_FUNC fx32 FX_ModS32(fx32 num, fx32 mod){ reg_CP_DIVCNT = 0x0; - *(REGType32 *)REG_DIV_NUMER_ADDR = (u32)num; //32bit write for some reason + *(REGType32 *)®_CP_DIV_NUMER = (u32)num; //32bit write for some reason reg_CP_DIV_DENOM = (u32)mod; while (reg_CP_DIVCNT & 0x8000); - return *(REGType32 *)REG_DIVREM_RESULT_ADDR; + return *(REGType32 *)®_CP_DIVREM_RESULT; } diff --git a/arm9/lib/src/OS_interrupt.c b/arm9/lib/src/OS_interrupt.c index f7a6d005..1fb43821 100644 --- a/arm9/lib/src/OS_interrupt.c +++ b/arm9/lib/src/OS_interrupt.c @@ -77,3 +77,13 @@ ARM_FUNC void OSi_EnterDmaCallback(u32 dmaNo, void (*callback) (void *), void *a OSi_IrqCallbackInfo[dmaNo].enable = OS_EnableIrqMask(mask) & mask; } + +ARM_FUNC void OSi_EnterTimerCallback(u32 timerNo, void (*callback) (void *), void *arg) +{ + OSIrqMask mask = 1UL << (timerNo + 3); + OSi_IrqCallbackInfo[timerNo + 4].func = callback; + OSi_IrqCallbackInfo[timerNo + 4].arg = arg; + + (void)OS_EnableIrqMask(mask); + OSi_IrqCallbackInfo[timerNo + 4].enable = TRUE; +} |