1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2025-07-02 04:42:33 +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,25 +70,20 @@ static char vcp_getchar(void) {
}
static void vcp_readline(char *buf, size_t len) {
for (;;) {
if (len == 0) return;
while (len > 1) {
char c = vcp_getchar();
if (c == '\r') {
vcp_puts("\r\n", 2);
break;
}
if (c < 32 || c > 126) { // not printable
continue;
}
if (len > 1) { // leave space for \0
*buf = c;
buf++;
len--;
vcp_puts(&c, 1);
}
}
if (len > 0) {
*buf = '\0';
}
}
static void usb_init_all(void) {