In the method of my main.c file, I declare the variable irq_raised, which is of type irq_type. I defined irq_type in typedef in another file and #import at the top of main.c.
typedef enum { IRQ_NONE = 0x0000, IRQ_VBLANK = 0x0001, IRQ_HBLANK = 0x0002, IRQ_VCOUNT = 0x0004, IRQ_TIMER0 = 0x0008, IRQ_TIMER1 = 0x0010, IRQ_TIMER2 = 0x0020, IRQ_TIMER3 = 0x0040, IRQ_SERIAL = 0x0080, IRQ_DMA0 = 0x0100, IRQ_DMA1 = 0x0200, IRQ_DMA2 = 0x0400, IRQ_DMA3 = 0x0800, IRQ_KEYPAD = 0x1000, IRQ_GAMEPAK = 0x2000, } irq_type;
I can assign this variable to one of them:
irq_raised = IRQ_NONE;
However, when I try to do the following:
irq_raised |= IRQ_HBLANK;
I get an error message:
Assigning to 'irq_type' from incompatible type 'int'
Why is this?
source share