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 @@ -218,10 +218,10 @@ void HWCDC::setTxTimeoutMs(uint32_t timeout){
218
218
219
219
size_t HWCDC::setTxBufferSize (size_t tx_queue_len){
220
220
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){
225
225
return 0 ;
226
226
}
227
227
tx_ring_buf = xRingbufferCreate (tx_queue_len, RINGBUF_TYPE_BYTEBUF);
@@ -319,19 +319,16 @@ void HWCDC::flush(void)
319
319
320
320
size_t HWCDC::setRxBufferSize (size_t rx_queue_len){
321
321
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){
326
326
return 0 ;
327
327
}
328
328
rx_queue = xQueueCreate (rx_queue_len, sizeof (uint8_t ));
329
329
if (!rx_queue){
330
330
return 0 ;
331
331
}
332
- if (!tx_ring_buf){
333
- tx_ring_buf = xRingbufferCreate (rx_queue_len, RINGBUF_TYPE_BYTEBUF);
334
- }
335
332
return rx_queue_len;
336
333
}
337
334
You can’t perform that action at this time.
0 commit comments