]> Joshua Wise's Git repositories - firearm.git/blobdiff - tests/testbench.c
Issue: AUTORESET.
[firearm.git] / tests / testbench.c
index 0c1cb7710ee7455cba0add789d267150ce470b93..e708df676b6169b0aa4e116e4b8c298b4e8be0bc 100644 (file)
@@ -1,5 +1,14 @@
 extern void putc(unsigned char c);
 
 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)
 void puts(unsigned char *s)
 {
        while (*s)
@@ -115,7 +124,9 @@ int main()
                puts(": ");
                t->test();
        }
                puts(": ");
                t->test();
        }
-       puts("Done!\n");
+       puts("Done! Echoing characters.\n");
        
        
+       while (1)
+               putc(serial_getc());
        return 0;
 }
        return 0;
 }
This page took 0.026353 seconds and 4 git commands to generate.