Add UART interrupts

Currently an interrupt is triggered any time there is any activity on
the UART_RXD line, but later it will only trigger once there is data
ready to be read.
This commit is contained in:
Byron Lathi
2022-03-14 14:57:45 -05:00
parent 0316d047e3
commit b2344d986e
4 changed files with 19 additions and 2 deletions

View File

@@ -4,6 +4,7 @@
#include <stdint.h>
#define BUTTON (1 << 0)
#define UART (1 << 1)
void irq_int();
void nmi_int();

View File

@@ -17,4 +17,8 @@ void handle_irq() {
puts("Button Interrupt!\n");
irq_set_status(status & ~BUTTON);
}
if (status & UART) {
puts("UART Interrupt!\n");
irq_set_status(status & ~UART);
}
}