File tree Expand file tree Collapse file tree 1 file changed +8
-11
lines changed Expand file tree Collapse file tree 1 file changed +8
-11
lines changed Original file line number Diff line number Diff line change @@ -254,10 +254,10 @@ void HWCDC::setTxTimeoutMs(uint32_t timeout){
254254
255255size_t HWCDC::setTxBufferSize (size_t tx_queue_len){
256256 if (tx_ring_buf){
257- if (!tx_queue_len){
258- vRingbufferDelete (tx_ring_buf) ;
259- tx_ring_buf = NULL ;
260- }
257+ vRingbufferDelete (tx_ring_buf);
258+ tx_ring_buf = NULL ;
259+ }
260+ if (!tx_queue_len){
261261 return 0 ;
262262 }
263263 tx_ring_buf = xRingbufferCreate (tx_queue_len, RINGBUF_TYPE_BYTEBUF);
@@ -355,19 +355,16 @@ void HWCDC::flush(void)
355355
356356size_t HWCDC::setRxBufferSize (size_t rx_queue_len){
357357 if (rx_queue){
358- if (!rx_queue_len){
359- vQueueDelete (rx_queue) ;
360- rx_queue = NULL ;
361- }
358+ vQueueDelete (rx_queue);
359+ rx_queue = NULL ;
360+ }
361+ if (!rx_queue_len){
362362 return 0 ;
363363 }
364364 rx_queue = xQueueCreate (rx_queue_len, sizeof (uint8_t ));
365365 if (!rx_queue){
366366 return 0 ;
367367 }
368- if (!tx_ring_buf){
369- tx_ring_buf = xRingbufferCreate (rx_queue_len, RINGBUF_TYPE_BYTEBUF);
370- }
371368 return rx_queue_len;
372369}
373370
You can’t perform that action at this time.
0 commit comments