|
|
|
@ -4,8 +4,6 @@
|
|
|
|
|
|
|
|
|
|
#define UARTBASE 0xE000C000 |
|
|
|
|
|
|
|
|
|
#define FP0XVAL (*((volatile unsigned int *) 0x3FFFC014)) |
|
|
|
|
|
|
|
|
|
#define RBR 0x00 |
|
|
|
|
#define THR 0x00 |
|
|
|
|
#define DLL 0x00 |
|
|
|
@ -172,14 +170,11 @@ void puthex(unsigned int n) {
|
|
|
|
|
putstr(s+i); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
char getch(void) { |
|
|
|
|
char c; |
|
|
|
|
|
|
|
|
|
while (uart_rxread == uart_rxwrite) { |
|
|
|
|
FP0XVAL ^= 0x04000000; |
|
|
|
|
} |
|
|
|
|
bool getch(char *c) { |
|
|
|
|
if (uart_rxread == uart_rxwrite) |
|
|
|
|
return FALSE; |
|
|
|
|
|
|
|
|
|
c = uart_rxbuf[uart_rxread]; |
|
|
|
|
*c = uart_rxbuf[uart_rxread]; |
|
|
|
|
uart_rxread = (uart_rxread + 1) % UART_RXBUFSIZE; |
|
|
|
|
return c; |
|
|
|
|
return TRUE; |
|
|
|
|
} |
|
|
|
|