Skip to content

Commit

Permalink
stin read from jtag
Browse files Browse the repository at this point in the history
  • Loading branch information
wizmo2 committed Oct 11, 2023
1 parent 0986e99 commit ef9b535
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion components/platform_console/platform_console.c
Original file line number Diff line number Diff line change
Expand Up @@ -270,10 +270,12 @@ static ssize_t stdin_read(int fd, void* data, size_t size) {
if (event.type == UART_DATA) {
#if defined (CONFIG_ESP_CONSOLE_UART_DEFAULT)
bytes = uart_read_bytes(CONFIG_ESP_CONSOLE_UART_NUM, data, size < event.size ? size : event.size, 0);
#elif defined (CONFIG_ESP_CONSOLE_USB_SERIAL_JTAG)
bytes = usb_serial_jtag_read_bytes(data, size < event.size ? size : event.size, 0);
#endif
// we have to do our own line ending translation here
for (int i = 0; i < bytes; i++) if (((char*)data)[i] == '\r') ((char*)data)[i] = '\n';
break;
#endif
}
} else if (xRingbufferCanRead(stdin_redir.handle, activated)) {
char *p = xRingbufferReceiveUpTo(stdin_redir.handle, &bytes, 0, size);
Expand Down

0 comments on commit ef9b535

Please sign in to comment.