X-Git-Url: http://git.joshuawise.com/firearm.git/blobdiff_plain/35c310849a3685b823e06456e220e5647135fe42..e3183a087362f1f2aef0af0cdc402de11a68cf50:/tests/testbench.c diff --git a/tests/testbench.c b/tests/testbench.c index 0c1cb77..e708df6 100644 --- a/tests/testbench.c +++ b/tests/testbench.c @@ -1,5 +1,14 @@ extern void putc(unsigned char c); +int serial_getc (void) +{ + int c; + do + asm volatile("mrc 5, 0, %0, c1, c1, 1" : "=r"(c)); + while (!(c & 0x100)); + return c & 0xFF; +} + void puts(unsigned char *s) { while (*s) @@ -115,7 +124,9 @@ int main() puts(": "); t->test(); } - puts("Done!\n"); + puts("Done! Echoing characters.\n"); + while (1) + putc(serial_getc()); return 0; }