Skip to content

Commit 55eebb9

Browse files
committed
more clean up, use log_pritnf for debugging tinyusb with esp32
1 parent 9eae19b commit 55eebb9

File tree

3 files changed

+6
-13
lines changed

3 files changed

+6
-13
lines changed

src/arduino/Adafruit_TinyUSB_API.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,7 @@
2424

2525
#include "tusb_option.h"
2626

27-
// ESP32 will use the arduino-esp32 core initialization and Serial
28-
#if CFG_TUD_ENABLED && !defined(ARDUINO_ARCH_ESP32)
27+
#if CFG_TUD_ENABLED
2928

3029
#include "Adafruit_TinyUSB.h"
3130
#include "Arduino.h"
@@ -48,6 +47,7 @@ void TinyUSB_Device_Task(void) {
4847
}
4948
#endif
5049

50+
#ifndef ARDUINO_ARCH_ESP32
5151
void TinyUSB_Device_FlushCDC(void) {
5252
uint8_t const cdc_instance = Adafruit_USBD_CDC::getInstanceCount();
5353
for (uint8_t instance = 0; instance < cdc_instance; instance++) {
@@ -88,8 +88,9 @@ __attribute__((used)) int CFG_TUSB_DEBUG_PRINTF(const char *__restrict format,
8888
va_end(ap);
8989
return len;
9090
}
91-
#endif
91+
#endif // CFG_TUSB_DEBUG
9292

93-
} // extern C
93+
#endif // ARDUINO_ARCH_ESP32
9494

95+
} // extern C
9596
#endif

src/arduino/video/Adafruit_USBD_Video.cpp

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -30,17 +30,9 @@
3030

3131
#include "Adafruit_USBD_Video.h"
3232

33-
#ifdef ARDUINO_ARCH_ESP32
34-
// static uint16_t hid_load_descriptor(uint8_t *dst, uint8_t *itf) {}
35-
#endif
36-
3733
Adafruit_USBD_Video::Adafruit_USBD_Video(void) {
3834
_vc_id = 0;
3935
memset(&_camera_terminal, 0, sizeof(_camera_terminal));
40-
41-
#ifdef ARDUINO_ARCH_ESP32
42-
// tinyusb_enable_interface(USB_INTERFACE_HID, desc_len, hid_load_descriptor);
43-
#endif
4436
}
4537

4638
bool Adafruit_USBD_Video::addTerminal(

src/tusb_config.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@
6262

6363
// Debug TinyUSB with Serial1
6464
#if CFG_TUSB_DEBUG
65-
#define CFG_TUSB_DEBUG_PRINTF serial1_printf
65+
#define CFG_TUSB_DEBUG_PRINTF log_printf
6666
#endif
6767

6868
#ifdef __cplusplus

0 commit comments

Comments
 (0)