We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b11eb25 commit 12882a4Copy full SHA for 12882a4
src/lib/logging/logging.cpp
@@ -13,14 +13,15 @@ Stream *BackpackOrLogStrm;
13
void debugPrintf(const char* fmt, ...)
14
{
15
char c;
16
- const char *v;
+ const char *v = nullptr;
17
char buf[21];
18
va_list vlist;
19
va_start(vlist,fmt);
20
21
c = GETCHAR;
22
while(c) {
23
if (c == '%') {
24
+ if (v) LOGGING_UART.write(v, fmt - v);
25
fmt++;
26
27
v = buf;
@@ -51,13 +52,15 @@ void debugPrintf(const char* fmt, ...)
51
52
break;
53
}
54
LOGGING_UART.write((uint8_t*)v, strlen(v));
55
+ v = nullptr;
56
} else {
- LOGGING_UART.write(c);
57
+ if (!v) v = fmt;
58
59
60
61
62
va_end(vlist);
63
64
65
66
#if defined(DEBUG_INIT)
0 commit comments