Add conio

Also removes print statements from the interrupt handler (except for the
button interrupt)
This commit is contained in:
Byron Lathi
2022-03-14 22:20:15 -05:00
parent 340f43103a
commit 15b91dcc20
3 changed files with 77 additions and 25 deletions

View File

@@ -1,30 +1,26 @@
#include <stdint.h>
#include <conio.h>
#include "interrupt.h"
#include "uart.h"
#include "sevenseg.h"
char lastchar;
// This is defined in main.c
void puts(const char* s);
void handle_irq() {
uint8_t status;
char c;
puts("Interrupt Detected!\n");
status = irq_get_status();
if (status & BUTTON) {
puts("Button Interrupt!\n");
cputs("Button Interrupt!\n");
irq_set_status(status & ~BUTTON);
}
if (status & UART) {
puts("UART Interrupt!\n");
c = uart_rxb();
puts("Received: ");
puts(&c);
puts("\n");
lastchar = uart_rxb();
irq_set_status(status & ~UART);
}
}