From 3f4d5871b8b575d6317dc119a8a5e4501e5211d4 Mon Sep 17 00:00:00 2001 From: Neradoc Date: Mon, 24 Mar 2025 21:21:40 +0100 Subject: [PATCH] revert PR 7100 restoring the ability to read the buffer when no serial client is connected the original issue is fixed in tinyusb --- shared-module/usb_cdc/Serial.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/shared-module/usb_cdc/Serial.c b/shared-module/usb_cdc/Serial.c index 3c67103afcee9..348729365c2fc 100644 --- a/shared-module/usb_cdc/Serial.c +++ b/shared-module/usb_cdc/Serial.c @@ -19,9 +19,7 @@ size_t common_hal_usb_cdc_serial_read(usb_cdc_serial_obj_t *self, uint8_t *data, // Read up to len bytes immediately. // The number of bytes read will not be larger than what is already in the TinyUSB FIFO. uint32_t total_num_read = 0; - if (tud_cdc_n_connected(self->idx)) { - total_num_read = tud_cdc_n_read(self->idx, data, len); - } + total_num_read = tud_cdc_n_read(self->idx, data, len); if (wait_forever || wait_for_timeout) { // Continue filling the buffer past what we already read. @@ -48,9 +46,7 @@ size_t common_hal_usb_cdc_serial_read(usb_cdc_serial_obj_t *self, uint8_t *data, data += num_read; // Try to read another batch of bytes. - if (tud_cdc_n_connected(self->idx)) { - num_read = tud_cdc_n_read(self->idx, data, len); - } + num_read = tud_cdc_n_read(self->idx, data, len); total_num_read += num_read; } } pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy