-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathdebug1.patch
33 lines (30 loc) · 1.12 KB
/
debug1.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
diff --git a/.pio/libdeps/pico/Adafruit TinyUSB Library/src/arduino/Adafruit_TinyUSB_API.cpp b/.pio/libdeps/pico/Adafruit TinyUSB Library/src/arduino/Adafruit_TinyUSB_API.cpp
index 8af08a4..b0449dd 100644
--- a/.pio/libdeps/pico/Adafruit TinyUSB Library/src/arduino/Adafruit_TinyUSB_API.cpp
+++ b/.pio/libdeps/pico/Adafruit TinyUSB Library/src/arduino/Adafruit_TinyUSB_API.cpp
@@ -68,24 +68,21 @@ #ifdef USE_SEGGER_RTT
#include "SEGGER_RTT/RTT/SEGGER_RTT.h"
#endif
+extern "C++" {
+ Stream *TinyUSB_Serial_Debug = nullptr;
+}
__attribute__((used)) int CFG_TUSB_DEBUG_PRINTF(const char *__restrict format,
...) {
char buf[256];
int len;
va_list ap;
va_start(ap, format);
len = vsnprintf(buf, sizeof(buf), format, ap);
#ifdef USE_SEGGER_RTT
SEGGER_RTT_Write(0, buf, len);
#else
- static volatile bool ser_inited = false;
- if (!ser_inited) {
- ser_inited = true;
- SERIAL_TUSB_DEBUG.begin(115200);
- // SERIAL_TUSB_DEBUG.begin(921600);
- }
- SERIAL_TUSB_DEBUG.write(buf);
+ if (TinyUSB_Serial_Debug) TinyUSB_Serial_Debug->write(buf);
#endif
va_end(ap);