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 @@ -218,10 +218,10 @@ void HWCDC::setTxTimeoutMs(uint32_t timeout){
218218
219219size_t HWCDC::setTxBufferSize (size_t tx_queue_len){
220220 if (tx_ring_buf){
221- if (!tx_queue_len){
222- vRingbufferDelete (tx_ring_buf) ;
223- tx_ring_buf = NULL ;
224- }
221+ vRingbufferDelete (tx_ring_buf);
222+ tx_ring_buf = NULL ;
223+ }
224+ if (!tx_queue_len){
225225 return 0 ;
226226 }
227227 tx_ring_buf = xRingbufferCreate (tx_queue_len, RINGBUF_TYPE_BYTEBUF);
@@ -319,19 +319,16 @@ void HWCDC::flush(void)
319319
320320size_t HWCDC::setRxBufferSize (size_t rx_queue_len){
321321 if (rx_queue){
322- if (!rx_queue_len){
323- vQueueDelete (rx_queue) ;
324- rx_queue = NULL ;
325- }
322+ vQueueDelete (rx_queue);
323+ rx_queue = NULL ;
324+ }
325+ if (!rx_queue_len){
326326 return 0 ;
327327 }
328328 rx_queue = xQueueCreate (rx_queue_len, sizeof (uint8_t ));
329329 if (!rx_queue){
330330 return 0 ;
331331 }
332- if (!tx_ring_buf){
333- tx_ring_buf = xRingbufferCreate (rx_queue_len, RINGBUF_TYPE_BYTEBUF);
334- }
335332 return rx_queue_len;
336333}
337334
You can’t perform that action at this time.
0 commit comments