Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
arduino-esp32
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
xpstem
arduino-esp32
Commits
18164e6f
Unverified
Commit
18164e6f
authored
Jun 29, 2023
by
Rodrigo Garcia
Committed by
GitHub
Jun 29, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixes crash when calling twice end() (#8332)
parent
72c41d09
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
11 deletions
+8
-11
cores/esp32/HWCDC.cpp
cores/esp32/HWCDC.cpp
+8
-11
No files found.
cores/esp32/HWCDC.cpp
View file @
18164e6f
...
@@ -218,10 +218,10 @@ void HWCDC::setTxTimeoutMs(uint32_t timeout){
...
@@ -218,10 +218,10 @@ void HWCDC::setTxTimeoutMs(uint32_t timeout){
size_t
HWCDC
::
setTxBufferSize
(
size_t
tx_queue_len
){
size_t
HWCDC
::
setTxBufferSize
(
size_t
tx_queue_len
){
if
(
tx_ring_buf
){
if
(
tx_ring_buf
){
if
(
!
tx_queue_len
){
vRingbufferDelete
(
tx_ring_buf
);
vRingbufferDelete
(
tx_ring_buf
)
;
tx_ring_buf
=
NULL
;
tx_ring_buf
=
NULL
;
}
}
if
(
!
tx_queue_len
){
return
0
;
return
0
;
}
}
tx_ring_buf
=
xRingbufferCreate
(
tx_queue_len
,
RINGBUF_TYPE_BYTEBUF
);
tx_ring_buf
=
xRingbufferCreate
(
tx_queue_len
,
RINGBUF_TYPE_BYTEBUF
);
...
@@ -319,19 +319,16 @@ void HWCDC::flush(void)
...
@@ -319,19 +319,16 @@ void HWCDC::flush(void)
size_t
HWCDC
::
setRxBufferSize
(
size_t
rx_queue_len
){
size_t
HWCDC
::
setRxBufferSize
(
size_t
rx_queue_len
){
if
(
rx_queue
){
if
(
rx_queue
){
if
(
!
rx_queue_len
){
vQueueDelete
(
rx_queue
);
vQueueDelete
(
rx_queue
)
;
rx_queue
=
NULL
;
rx_queue
=
NULL
;
}
}
if
(
!
rx_queue_len
){
return
0
;
return
0
;
}
}
rx_queue
=
xQueueCreate
(
rx_queue_len
,
sizeof
(
uint8_t
));
rx_queue
=
xQueueCreate
(
rx_queue_len
,
sizeof
(
uint8_t
));
if
(
!
rx_queue
){
if
(
!
rx_queue
){
return
0
;
return
0
;
}
}
if
(
!
tx_ring_buf
){
tx_ring_buf
=
xRingbufferCreate
(
rx_queue_len
,
RINGBUF_TYPE_BYTEBUF
);
}
return
rx_queue_len
;
return
rx_queue_len
;
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment