Page 1 of 1

Serial class behaviour

Posted: Sun Aug 26, 2018 5:52 pm
by aster94
hello

in many cores (at least avr and arm) the serial class could be passed as constructor for functions, example:

Code: Select all

foo(&Serial1);
how could i achieve something similar on esp32?

i tried this but it didn't work:

Code: Select all

#include <HardwareSerial.h>
HardwareSerial MySerial(1);
foo(&MySerial);

Re: Serial class behaviour

Posted: Mon Aug 27, 2018 2:51 am
by ESP_Sprite
Arduino (what you seem to be using) is C++, and the C++ support on ESP32s should be the same as on ARM or AVR. Can you elaborate a bit further on the error rather than just saying 'it didn't work'?

Also moving this to the Arduino subforum, as your question is specific to that.

Re: Serial class behaviour

Posted: Mon Aug 27, 2018 8:48 pm
by aster94
my fault, i was using a specific function of another core which i thought to be also from arduino, this could be closed/delated