Closed sandeepmistry closed 3 years ago
I'm looking at this now. This is a weird one, I'm trying to decipher the original Engineer's intent but I'll hopefully get an update here in not too long.
@edspark great, I think this file was based on the SparkFun_SAMD21_Dev/variant.h however the RedBoard Turbo doesn't have the UART Serial pins present.
Sorry for the delay. As you mentioned the Turbo did not have Serial pins defined, but did have Serial1 pins defined. To me, the inclusion of a Serial1 port implies that there's a Serial port. So I removed Serial1 in favor of Serial and removed the extern to Serial1. Documentation else where will have to be updated but this is more consistent with out other SAMD21 variants. Thanks @sandeepmistry!
@edspark cool, thanks for making the change!
For greater sketch compatibility my preference would still be to have SerialUSB
mapped to Serial
and Serial1
be mapped to the physical pins (0, 1) like they are on the Arduino Leonardo and SAMD21 based MKR boards.
That said, I understand if the change you made in https://github.com/sparkfun/Arduino_Boards/commit/72d571dc6e2b4f5b0fad3154e6282f66e0971fcc is preferable for SparkFun.
Sorry for the delay in the release but I'm glad I stepped away. I agree with you @sandeepmistry, so I went ahead and kept Serial1 as it was previously but commented out the troublesome extern
. In addition there are comments in the variant files stating that there are pins defined for Serial
, but that they're not physically available. Anyway, the changes were included in 1.8.6.
Hi @edspark,
There's still one change that's missing, the Arduino MKR Zero has the following in the variant.h
file: https://github.com/arduino/ArduinoCore-samd/blob/master/variants/mkrzero/variant.h#L208-L209
// Alias Serial to SerialUSB
#define Serial SerialUSB
When using the following sketch:
I get the following linker errors during compilation:
Would it make sense to replace the
extern Uart Serial;
line insparkfun/samd/variants/SparkFun_RedBoard_Turbo/variant.h
with a#define Serial SerialUSB
statement like in the Arduino MKRZERO board variant ?