FrSky
FrSky copied to clipboard
Add explanation to readme about how to use the hardward serial.
Hello, I didn't know how to ask this elsaway, but can you explain how to use it with the hardware serial instead of the sofware one ? All your example look like using the software serial, thanks.
Better documentation is a good idea 😊
You can use hardware serial like this:
SPortHub hub(0x12, Serial);
Wow, easy like that! Thanks
Unfortunately, this solution does not work due to several reasons:
- The constructor of SPortHub with a Serial parameter is hidden in a strange conditional compilation statement:
#ifdef Serial_
SPortHub(int physicalId, Serial_& serial);
#elif HardwareSerial
SPortHub(int physicalId, HardwareSerial& serial);
#endif
I think, the different constructors shall be all visible and overloaded.
- Because of the conversion operator
Serial_::operator bool()in the classSerial_the constructor used forSPortHub(0x12, Serial);is again;SPortHub(int physicalId, int softwarePin);which makes no sense at all, but we get no error message here.