Skip to content

Commit 5593abf

Browse files
committed
Remove USBCDCD patch
Patch was introduced to allow bootloader update using rfp-cli, but seems to cause sketch upload issues. Bootloader update is still possible adding -dtr flag to rfp-cli command.
1 parent 982aa36 commit 5593abf

File tree

1 file changed

+0
-42
lines changed

1 file changed

+0
-42
lines changed

core_esp32.patch

Lines changed: 0 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,3 @@
1-
diff --git a/cores/esp32/USBCDC.cpp b/cores/esp32/USBCDC.cpp
2-
index ccf5180d..94895dcd 100644
3-
--- a/cores/esp32/USBCDC.cpp
4-
+++ b/cores/esp32/USBCDC.cpp
5-
@@ -349,7 +349,7 @@ size_t USBCDC::read(uint8_t *buffer, size_t size)
6-
7-
void USBCDC::flush(void)
8-
{
9-
- if(itf >= MAX_USB_CDC_DEVICES || tx_lock == NULL || !tud_cdc_n_connected(itf)){
10-
+ if(itf >= MAX_USB_CDC_DEVICES || tx_lock == NULL){
11-
return;
12-
}
13-
if(xSemaphoreTake(tx_lock, tx_timeout_ms / portTICK_PERIOD_MS) != pdPASS){
14-
@@ -361,7 +361,7 @@ void USBCDC::flush(void)
15-
16-
int USBCDC::availableForWrite(void)
17-
{
18-
- if(itf >= MAX_USB_CDC_DEVICES || tx_lock == NULL || !tud_cdc_n_connected(itf)){
19-
+ if(itf >= MAX_USB_CDC_DEVICES || tx_lock == NULL){
20-
return 0;
21-
}
22-
if(xSemaphoreTake(tx_lock, tx_timeout_ms / portTICK_PERIOD_MS) != pdPASS){
23-
@@ -374,7 +374,7 @@ int USBCDC::availableForWrite(void)
24-
25-
size_t USBCDC::write(const uint8_t *buffer, size_t size)
26-
{
27-
- if(itf >= MAX_USB_CDC_DEVICES || tx_lock == NULL || buffer == NULL || size == 0 || !tud_cdc_n_connected(itf)){
28-
+ if(itf >= MAX_USB_CDC_DEVICES || tx_lock == NULL || buffer == NULL || size == 0){
29-
return 0;
30-
}
31-
if(xPortInIsrContext()){
32-
@@ -387,10 +387,6 @@ size_t USBCDC::write(const uint8_t *buffer, size_t size)
33-
}
34-
size_t to_send = size, so_far = 0;
35-
while(to_send){
36-
- if(!tud_cdc_n_connected(itf)){
37-
- size = so_far;
38-
- break;
39-
- }
40-
size_t space = tud_cdc_n_write_available(itf);
41-
if(!space){
42-
tud_cdc_n_write_flush(itf);
431
diff --git a/libraries/USB/src/USBHID.cpp b/libraries/USB/src/USBHID.cpp
442
index 521e0803..bb752b35 100644
453
--- a/libraries/USB/src/USBHID.cpp

0 commit comments

Comments
 (0)