Files
super6502/sw/irq.c
Byron Lathi f5dbe46060 Add irq_set_status
irq_set_status can be used to clear the irq status bit so that the
interrupt will stop occuring.
2022-03-14 13:34:33 -05:00

20 lines
324 B
C

#include <stdint.h>
#include "interrupt.h"
// This is defined in main.c
void puts(const char* s);
void handle_irq() {
uint8_t status;
puts("Interrupt Detected!\n");
status = irq_get_status();
if (status & BUTTON) {
puts("Button Interrupt!\n");
irq_set_status(status & ~BUTTON);
}
}