in many cores (at least avr and arm) the serial class could be passed as constructor for functions, example:
Code: Select all
foo(&Serial1);
i tried this but it didn't work:
Code: Select all
#include <HardwareSerial.h>
HardwareSerial MySerial(1);
foo(&MySerial);