Fixes HWCDC::end() (#8247)

* Fixes HWCDC::end()

There is a missing `tx_lock = NULL;`

* Update HWCDC.cpp

Initialize rx_data_buf[] with zeros.
This commit is contained in:
Rodrigo Garcia 2023-05-31 08:11:17 -03:00 committed by GitHub
parent 3ec5f4efa1
commit 083db166a1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -28,7 +28,7 @@ ESP_EVENT_DEFINE_BASE(ARDUINO_HW_CDC_EVENTS);
static RingbufHandle_t tx_ring_buf = NULL;
static xQueueHandle rx_queue = NULL;
static uint8_t rx_data_buf[64];
static uint8_t rx_data_buf[64] = {0};
static intr_handle_t intr_handle = NULL;
static volatile bool initial_empty = false;
static xSemaphoreHandle tx_lock = NULL;
@ -195,6 +195,7 @@ void HWCDC::end()
intr_handle = NULL;
if(tx_lock != NULL) {
vSemaphoreDelete(tx_lock);
tx_lock = NULL;
}
setRxBufferSize(0);
setTxBufferSize(0);