diff options
author | Bad Diode <bd@badd10de.dev> | 2024-05-10 17:49:56 +0200 |
---|---|---|
committer | Bad Diode <bd@badd10de.dev> | 2024-05-10 17:49:56 +0200 |
commit | 33451307ae4e3a4119dd6be46b25aec03aa51b5d (patch) | |
tree | 3dde87e12187e3400cd60f9045678f3fb29adca1 /src/gba/gba.h | |
parent | 901ba917a3b4812f7eacf93d55389978a907a44d (diff) | |
download | stepper-33451307ae4e3a4119dd6be46b25aec03aa51b5d.tar.gz stepper-33451307ae4e3a4119dd6be46b25aec03aa51b5d.zip |
Ensure long irs sequencer_tick can be interrupted
Diffstat (limited to 'src/gba/gba.h')
-rw-r--r-- | src/gba/gba.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/gba/gba.h b/src/gba/gba.h index 3f629fd..1bb3afd 100644 --- a/src/gba/gba.h +++ b/src/gba/gba.h | |||
@@ -534,6 +534,14 @@ void irs_set(IrqIndex idx, IrsFunc func); | |||
534 | // assembly and enable interrupts. | 534 | // assembly and enable interrupts. |
535 | void irq_init(void); | 535 | void irq_init(void); |
536 | 536 | ||
537 | // Only should be used inside an IrsFunc to enable it being interrupted by the | ||
538 | // given interrupt (nested IRS). | ||
539 | static inline void | ||
540 | irs_interruptible(IrqIndex idx) { | ||
541 | IRQ_ENABLE |= (1 << idx); | ||
542 | IRQ_CTRL = 1; | ||
543 | } | ||
544 | |||
537 | // | 545 | // |
538 | // BIOS function declarations. | 546 | // BIOS function declarations. |
539 | // | 547 | // |