When data was sent through USB Serial JTAG before the
driver was installed, the bus was malfunctioning. This
was because the interrupt bit for data reception was cleared
regardless of whether data was received or not. Consequently,
usb_serial_jtag_isr_handler_default was not triggered and the
data was never read causing the bus to malfunction.
This commit is modifying usb_serial_jtag_driver_install to
prevent clearing USB_SERIAL_JTAG_INTR_SERIAL_OUT_RECV_PKT and
USB_SERIAL_JTAG_INTR_SERIAL_IN_EMPTY thus allowing the callback
usb_serial_jtag_isr_handler_default to trigger for possible data
exchanged prior to the call to usb_serial_jtag_driver_install.
This commit also modified the while logic in linenoiseProbe to
discard any data that doesn't match the expected chaaracter sequences
to prevent random input from interfering with evaluating whether the
terminal supports escape sequences or not.
See https://github.com/espressif/esp-idf/issues/13940
This commit fixes a potential issue where in the prompt length used
for the linenoise based console could be calculated as a negative
integer, leading to a console hang.
Closes https://github.com/espressif/esp-idf/issues/4924
Previously linenoiseProbe would accept any 4 byte response, even one
that isn't expected. This adds a check that the first byte of the
response is ESC.
Suggested in https://github.com/espressif/esp-idf/issues/8839.
Console example doesn't duplicate code in `console` component.
Linenoise has been improved: it now has a parametrized command line
length. It is now possible to paste data efficiently to the console.
Note: this can only be done if the cursor is at the end of the line.
Closes https://github.com/espressif/esp-idf/issues/7057
Fixes a regression from 753a92952: if cb was negative, read_bytes
overflowed, because the type was changed from int to size_t.
Also fixes incorrect timeout calculation: timeout_ms was 200, but
each iteration delayed for 10ms, and reduced timeout_ms by 1. This
made the effective timeout to be 2000ms.
Calloc function tries to allocate 4096 bytes.
If such memory is not available, it returns NULL pointer.
This exception was not handled in the code, causing a dirty crash.
A 0 length string is still a valid input and should be treated as such, a NULL return should be reserved for when errors occur during line editing or EOF is reached.
Merges https://github.com/espressif/esp-idf/pull/4926