Closed sticilface closed 7 years ago
changing it to this works
#if !defined(ARDUINO_ARCH_AVR)
#if !defined(ARDUINO_ARCH_ESP8266)
#if !defined(vsnprintf_P)
#if !defined(ESP8266)
#pragma message("vsnprintf((buf), (len), (fmt), (args))")
#define vsnprintf_P(buf, len, fmt, args) vsnprintf((buf), (len), (fmt), (args))
#endif
#endif
#endif
#endif
I guess actually... the logic needs &&
not ||
#if !defined(ARDUINO_ARCH_AVR) && !defined(ARDUINO_ARCH_ESP8266) && !defined(vsnprintf_P) && !defined(ESP8266)
#pragma message("vsnprintf((buf), (len), (fmt), (args))")
#define vsnprintf_P(buf, len, fmt, args) vsnprintf((buf), (len), (fmt), (args))
#endif
For the condition to be met you want them all to be true, if one is present then do not define
Fixed in 532370ce893ab7f762a7f5e083c3af34ef0e7cc6.
This took a long time for me to track down. Using the Arduino IDE for ESP8266.
In a nutshell, including syslog causes
vsnprintf_P
to be redefined asvsnprintf
.Tested by including a #pragma message("redefined") within the if !defined block.
output from compiler
The result of this is that use of it in that lib causes an immediate crash as it using the standard vsnprintf function. Removing the
#define vsnprintf_P(buf, len, fmt, args) vsnprintf((buf), (len), (fmt), (args))
causes everything to work fine.This took a lot of weirdness to figure out, especially as vsnprintf_P functions for serial were still working. The odd thing is that these defines do exist..
ARDUINO_ARCH_ESP8266
andESP8266
, which i added.any ideas?