gbdk-2020 | GameBoy Development Kit |
| download: https://git.y1.nz/archives/gbdk.tar.gz | |
| README | Files | Log | Refs | LICENSE |
commit 5774ae4acc7ff84a3199732128ea8b0dfdec39c3 parent 6b4ae396ca19c76566e430552ceffd23be17f6c3 Author: Toxa <untoxa@mail.ru> Date: Sat, 4 Sep 2021 20:29:16 +0300 GB: ISR_NESTED_VECTOR() macro Diffstat:
| M | gbdk-lib/include/gb/isr.h | 16 | +++++++++++++++- |
1 file changed, 15 insertions(+), 1 deletion(-)
diff --git a/gbdk-lib/include/gb/isr.h b/gbdk-lib/include/gb/isr.h @@ -26,7 +26,21 @@ typedef struct isr_vector_t { @param FUNC ISR function */ #define ISR_VECTOR(ADDR, FUNC) \ -static const isr_vector_t __at((ADDR)) __ISR_ ## ADDR = {0xc3, (void *)&(FUNC) }; +static const isr_vector_t __at((ADDR)) __ISR_ ## ADDR = {0xc3, (void *)&(FUNC)}; + +typedef struct isr_nested_vector_t { + uint8_t opcode[2]; + void * func; +} isr_vector_t; + +/** Creates the interrupt vector at the given address for the raw interrupt service routrine allowing nested inteerupts + + @param ADDR address of the vector + + @param FUNC ISR function +*/ +#define ISR_NESTED_VECTOR(ADDR, FUNC) \ +static const isr_nested_vector_t __at((ADDR)) __ISR_ ## ADDR = {{0xfb, 0xc3}, (void *)&(FUNC)}; #endif // _ISR_H_INCLUDE_
This webpage is intended to be an accessible preview of this repository. To get a fuller picture, clone it and use the git CLI.