uart: upgrade C api

This commit is contained in:
Paul Mathieu
2021-03-13 15:49:28 -08:00
parent 5d5eeb45cc
commit 75b5488b8d
4 changed files with 27 additions and 20 deletions

View File

@@ -1,13 +1,15 @@
#include "led.h"
#include "uart.h"
#define uart0 ((struct uart*)0xc010)
int main() {
int c;
int led = 0;
while (1) {
led_write(1 << led);
c = uart_read();
c = uart_read(uart0);
if (c == 'a') {
led++;