embeddedartistry / arduino-printf

Add printf support to the Arduino SDK
MIT License
91 stars 15 forks source link

Support Arduino Uno Wifi Rev 2 #11

Closed phillipjohnston closed 4 years ago

phillipjohnston commented 4 years ago

It appears that it doesn’t support the standard SDK.

In file included from /Users/phillip/Documents/Arduino/libraries/LibPrintf/src/LibPrintf.cpp:1:0: /Users/phillip/Documents/Arduino/libraries/LibPrintf/src/LibPrintf.h:13:18: error: variable or field 'printf_init' declared void void printf_init(Print& StreamClass); ^~~~~ /Users/phillip/Documents/Arduino/libraries/LibPrintf/src/LibPrintf.h:13:18: error: 'Print' was not declared in this scope /Users/phillip/Documents/Arduino/libraries/LibPrintf/src/LibPrintf.h:13:18: note: suggested alternative: In file included from /Users/phillip/Library/Arduino15/packages/arduino/hardware/megaavr/1.8.6/cores/arduino/api/deprecated/Print.h:23:0, from /Users/phillip/Documents/Arduino/libraries/LibPrintf/src/LibPrintf.h:4, from /Users/phillip/Documents/Arduino/libraries/LibPrintf/src/LibPrintf.cpp:1: /Users/phillip/Library/Arduino15/packages/arduino/hardware/megaavr/1.8.6/cores/arduino/api/deprecated/../Print.h:34:7: note: 'arduino::Print' class Print ^~~~~ In file included from /Users/phillip/Documents/Arduino/libraries/LibPrintf/src/LibPrintf.cpp:1:0: /Users/phillip/Documents/Arduino/libraries/LibPrintf/src/LibPrintf.h:13:25: error: 'StreamClass' was not declared in this scope void printf_init(Print& StreamClass); ^~~ exit status 1 Error compiling for board Arduino Uno WiFi Rev2. Changing the namespace gets us past this:

void printf_init(arduino::Print& StreamClass);