We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 893df5c commit fbdccf8Copy full SHA for fbdccf8
cores/nRF5/Print.cpp
@@ -22,6 +22,7 @@
22
#include <string.h>
23
#include <math.h>
24
#include "Arduino.h"
25
+#include "printf.h"
26
27
#include "Print.h"
28
@@ -187,11 +188,16 @@ size_t Print::println(const Printable& x)
187
188
return n;
189
}
190
191
+extern "C" void streamOutput(char character, void* arg)
192
+{
193
+ (static_cast<Print *>(arg))->write(character);
194
+}
195
+
196
int Print::printf(const char* format, ...)
197
{
198
va_list va;
199
va_start(va, format);
- int ret = vprintf(format, va);
200
+ int ret = vfctprintf(&streamOutput, this, format, va);
201
va_end(va);
202
return ret;
203
0 commit comments