nRF5x
nRF5x copied to clipboard
Add Nano V2 specific board define to library compiles to fix the WStream Incompatibility
The Arduino support for Nano V2 is not compatiable with Arduino Stream.
The Nano V2 replaces the Arduino Stream with WStream while calls to Stream pick up the incompatible mbed::Stream
This breaks standard libraries.
One solution is to add the following
#if defined( ARDUINO_RBL_nRF52832)
#include <WStream.h>
#define Stream WStream
#else
#include <Stream.h>
#endif
But this does not work because ARDUINO_RBL_nRF52832 is only defined when detecting libraries and is not defined when compiling included libraries via the Arduino IDE Please make a board specific define available that is defined only for this board and defined for ALL compilations.
Note for Nano V1.5
ARDUINO_RBL_nRF51822
is defined for both detecting libraries and for compiling libraries