Merge pull request #109 from stv0g/cmd-echo

Added echo command to PicoSoc firmware for testing UART
This commit is contained in:
Clifford Wolf 2019-02-13 14:07:08 +01:00 committed by GitHub
commit e9e311d53e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 12 additions and 0 deletions

View File

@ -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;
}