Skip to content

Commit

Permalink
Merge branch 'master' into esp-idf-v5.1-libs
Browse files Browse the repository at this point in the history
  • Loading branch information
me-no-dev authored Jun 29, 2023
2 parents 9507124 + 18164e6 commit 07bf7be
Showing 1 changed file with 8 additions and 11 deletions.
19 changes: 8 additions & 11 deletions cores/esp32/HWCDC.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -254,10 +254,10 @@ void HWCDC::setTxTimeoutMs(uint32_t timeout){

size_t HWCDC::setTxBufferSize(size_t tx_queue_len){
if(tx_ring_buf){
if(!tx_queue_len){
vRingbufferDelete(tx_ring_buf);
tx_ring_buf = NULL;
}
vRingbufferDelete(tx_ring_buf);
tx_ring_buf = NULL;
}
if(!tx_queue_len){
return 0;
}
tx_ring_buf = xRingbufferCreate(tx_queue_len, RINGBUF_TYPE_BYTEBUF);
Expand Down Expand Up @@ -355,19 +355,16 @@ void HWCDC::flush(void)

size_t HWCDC::setRxBufferSize(size_t rx_queue_len){
if(rx_queue){
if(!rx_queue_len){
vQueueDelete(rx_queue);
rx_queue = NULL;
}
vQueueDelete(rx_queue);
rx_queue = NULL;
}
if(!rx_queue_len){
return 0;
}
rx_queue = xQueueCreate(rx_queue_len, sizeof(uint8_t));
if(!rx_queue){
return 0;
}
if(!tx_ring_buf){
tx_ring_buf = xRingbufferCreate(rx_queue_len, RINGBUF_TYPE_BYTEBUF);
}
return rx_queue_len;
}

Expand Down

0 comments on commit 07bf7be

Please sign in to comment.