Skip to content

Commit

Permalink
Fix Print::printf implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
tsl0922 authored and h2zero committed Jan 15, 2025
1 parent 893df5c commit c3d85f6
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion cores/nRF5/Print.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,15 @@
#include <string.h>
#include <math.h>
#include "Arduino.h"
#include "libc/printf/printf.h"

#include "Print.h"

extern "C" void streamOutput(char c, void* arg)
{
(static_cast<Print *>(arg))->write(c);
}

// Public Methods //////////////////////////////////////////////////////////////

/* default implementation: may be overridden */
Expand Down Expand Up @@ -191,7 +197,7 @@ int Print::printf(const char* format, ...)
{
va_list va;
va_start(va, format);
int ret = vprintf(format, va);
int ret = vfctprintf(&streamOutput, this, format, va);
va_end(va);
return ret;
}
Expand Down

0 comments on commit c3d85f6

Please sign in to comment.