mirror of
https://github.com/trezor/trezor-firmware.git
synced 2025-07-04 13:52:35 +00:00
feat(core/prodtest): disable character echo
This commit is contained in:
parent
ed9fd35018
commit
5ab1efb1b7
@ -70,25 +70,20 @@ 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) {
|
||||||
|
Loading…
Reference in New Issue
Block a user