diff options
author | Steffen Vogel <post@steffenvogel.de> | 2019-02-11 21:26:45 +0100 |
---|---|---|
committer | Steffen Vogel <post@steffenvogel.de> | 2019-02-11 21:26:45 +0100 |
commit | 672c99b71e16ace182b2d54819cd93916159d570 (patch) | |
tree | 525176f422a0d7421f01fc95fad69c138b4930cf | |
parent | 9b7092110373932e9c40b8628820ebfe44da8668 (diff) | |
download | picorv32-672c99b71e16ace182b2d54819cd93916159d570.tar.gz picorv32-672c99b71e16ace182b2d54819cd93916159d570.zip |
added echo command for testing simpleuart
-rw-r--r-- | picosoc/firmware.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/picosoc/firmware.c b/picosoc/firmware.c index e3eed76..b53fa0e 100644 --- a/picosoc/firmware.c +++ b/picosoc/firmware.c @@ -550,6 +550,14 @@ void cmd_benchmark_all() } #endif +void cmd_echo() +{ + print("Return to menu by sending '!'\n\n"); + char c; + while ((c = getchar()) != '!') + putchar(c); +} + // -------------------------------------------------------- void main() @@ -611,6 +619,7 @@ void main() print(" [7] Toggle continuous read mode\n"); print(" [9] Run simplistic benchmark\n"); print(" [0] Benchmark all configs\n"); + print(" [e] Echo UART\n"); print("\n"); for (int rep = 10; rep > 0; rep--) @@ -650,6 +659,9 @@ void main() case '0': cmd_benchmark_all(); break; + case 'e': + cmd_echo(); + break; default: continue; } |