From 121556d62c2c40b07a709ef038fa1ce0a67127c9 Mon Sep 17 00:00:00 2001 From: Joshua Wise Date: Tue, 17 Mar 2009 21:09:09 -0400 Subject: [PATCH] testbench: Add a putc(getc()) loop. --- tests/testbench.c | 13 ++++++++++++- tests/testbench.hex | Bin 22608 -> 14742 bytes 2 files changed, 12 insertions(+), 1 deletion(-) 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; } diff --git a/tests/testbench.hex b/tests/testbench.hex index 062742765c8e9b7cc2f3e923557703220111b870..1335254ac443ef7f5b2ef291a4ad840f3ee76503 100644 GIT binary patch literal 14742 zcmd5@S(4-`4E*!#Owl zq4C?vpKrWpOY0inZtir>H~8E2=ZV2+*_}HYzjnv5IE?9r9W#Ku8xBl}htZ*d;2~=9P%U5$>!R?j2p@GvOW*ZSr^Elw zopCT&xTOON(KOfxgYiR)=ykA5<`F|hBRE(1G1NwDtO!#=LRwa}b2^4-5z{eUb{9vAE5Z%BA zEF_vH_*7j9YluA3l2f&f`h?LfR12cJpaOYr9}F(2W))0hS$K_zl!B@+sU8;ZQNoe) zqG zR5do*+Fxf$byPOY)>FX-S_*$LWOBV+<*&AiFHa<7){sR!ODRFqB&Bq)p=}rd33S01 zH!Bf?2(rH3IcUHt3ryGvogDY0L_$q|@9v*y8oex{ey`~WK-QxElbUWC4(gQeHRb;2PSZD#;BNVW zF-9(a&vMl7ICn|C^S`UiC8q4Edr4x4Sw2`Y27OZmjzLz-J;p6pcn zJML~%j1{`SfheNGEh)LV>7Pv94zXj=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