File tree 1 file changed +8
-11
lines changed
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){
254
254
255
255
size_t HWCDC::setTxBufferSize (size_t tx_queue_len){
256
256
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){
261
261
return 0 ;
262
262
}
263
263
tx_ring_buf = xRingbufferCreate (tx_queue_len, RINGBUF_TYPE_BYTEBUF);
@@ -355,19 +355,16 @@ void HWCDC::flush(void)
355
355
356
356
size_t HWCDC::setRxBufferSize (size_t rx_queue_len){
357
357
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){
362
362
return 0 ;
363
363
}
364
364
rx_queue = xQueueCreate (rx_queue_len, sizeof (uint8_t ));
365
365
if (!rx_queue){
366
366
return 0 ;
367
367
}
368
- if (!tx_ring_buf){
369
- tx_ring_buf = xRingbufferCreate (rx_queue_len, RINGBUF_TYPE_BYTEBUF);
370
- }
371
368
return rx_queue_len;
372
369
}
373
370
You can’t perform that action at this time.
0 commit comments