Add conio
Also removes print statements from the interrupt handler (except for the button interrupt)
This commit is contained in:
16
sw/irq.c
16
sw/irq.c
@@ -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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user