Improv Serial -- don't wait for incoming bytes (#6089)

This commit is contained in:
Keith Burzinski 2024-01-13 02:21:28 -06:00 committed by GitHub
parent ed2ab9e962
commit d551a2eba2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -52,7 +52,7 @@ optional<uint8_t> ImprovSerialComponent::read_byte_() {
size_t available; size_t available;
uart_get_buffered_data_len(this->uart_num_, &available); uart_get_buffered_data_len(this->uart_num_, &available);
if (available) { if (available) {
uart_read_bytes(this->uart_num_, &data, 1, 20 / portTICK_PERIOD_MS); uart_read_bytes(this->uart_num_, &data, 1, 0);
byte = data; byte = data;
} }
} }
@ -71,7 +71,7 @@ optional<uint8_t> ImprovSerialComponent::read_byte_() {
#endif // USE_ESP32_VARIANT_ESP32S2 || USE_ESP32_VARIANT_ESP32S3 #endif // USE_ESP32_VARIANT_ESP32S2 || USE_ESP32_VARIANT_ESP32S3
#if defined(USE_ESP32_VARIANT_ESP32C3) || defined(USE_ESP32_VARIANT_ESP32C6) || defined(USE_ESP32_VARIANT_ESP32S3) #if defined(USE_ESP32_VARIANT_ESP32C3) || defined(USE_ESP32_VARIANT_ESP32C6) || defined(USE_ESP32_VARIANT_ESP32S3)
case logger::UART_SELECTION_USB_SERIAL_JTAG: { case logger::UART_SELECTION_USB_SERIAL_JTAG: {
if (usb_serial_jtag_read_bytes((char *) &data, 1, 20 / portTICK_PERIOD_MS)) { if (usb_serial_jtag_read_bytes((char *) &data, 1, 0)) {
byte = data; byte = data;
} }
break; break;