Skip to content

Commit 083db16

Browse files
authored
Fixes HWCDC::end() (espressif#8247)
* Fixes HWCDC::end() There is a missing `tx_lock = NULL;` * Update HWCDC.cpp Initialize rx_data_buf[] with zeros.
1 parent 3ec5f4e commit 083db16

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

cores/esp32/HWCDC.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ ESP_EVENT_DEFINE_BASE(ARDUINO_HW_CDC_EVENTS);
2828

2929
static RingbufHandle_t tx_ring_buf = NULL;
3030
static xQueueHandle rx_queue = NULL;
31-
static uint8_t rx_data_buf[64];
31+
static uint8_t rx_data_buf[64] = {0};
3232
static intr_handle_t intr_handle = NULL;
3333
static volatile bool initial_empty = false;
3434
static xSemaphoreHandle tx_lock = NULL;
@@ -195,6 +195,7 @@ void HWCDC::end()
195195
intr_handle = NULL;
196196
if(tx_lock != NULL) {
197197
vSemaphoreDelete(tx_lock);
198+
tx_lock = NULL;
198199
}
199200
setRxBufferSize(0);
200201
setTxBufferSize(0);

0 commit comments

Comments
 (0)