1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2025-07-04 05:42:34 +00:00

feat(core/prodtest): disable character echo

This commit is contained in:
matejcik 2023-09-27 11:03:57 +02:00
parent ed9fd35018
commit 5ab1efb1b7

View File

@ -70,26 +70,21 @@ static char vcp_getchar(void) {
} }
static void vcp_readline(char *buf, size_t len) { static void vcp_readline(char *buf, size_t len) {
for (;;) { if (len == 0) return;
while (len > 1) {
char c = vcp_getchar(); char c = vcp_getchar();
if (c == '\r') { if (c == '\r') {
vcp_puts("\r\n", 2);
break; break;
} }
if (c < 32 || c > 126) { // not printable if (c < 32 || c > 126) { // not printable
continue; continue;
} }
if (len > 1) { // leave space for \0
*buf = c; *buf = c;
buf++; buf++;
len--; len--;
vcp_puts(&c, 1);
} }
}
if (len > 0) {
*buf = '\0'; *buf = '\0';
} }
}
static void usb_init_all(void) { static void usb_init_all(void) {
enum { enum {