summaryrefslogtreecommitdiff
path: root/arm9/lib/src/OS_interrupt.c
diff options
context:
space:
mode:
authorMade <made111@gmx.de>2020-05-15 04:17:23 +0200
committerMade <made111@gmx.de>2020-05-15 04:17:23 +0200
commit4da3a82551b27f94c2f493fbf01cf58db711c03e (patch)
tree1ff9fd6cd8d79402abb9286bbd622901d33a4b54 /arm9/lib/src/OS_interrupt.c
parenta92d77224c8ec645752a56aa35cc8a8457cd4cd3 (diff)
parent0252f2028d60248db23770a6a33030b40fbcee1e (diff)
Merge branch 'master' of https://github.com/martmists/pokediamond
Diffstat (limited to 'arm9/lib/src/OS_interrupt.c')
-rw-r--r--arm9/lib/src/OS_interrupt.c10
1 files changed, 10 insertions, 0 deletions
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;
+}