PaulStoffregen / AltSoftSerial

Software emulated serial using hardware timers for improved compatibility
http://www.pjrc.com/teensy/td_libs_AltSoftSerial.html
328 stars 131 forks source link

Adding support for Arduino MKR family (SAMD architecture) #70

Open simon-77 opened 1 month ago

simon-77 commented 1 month ago

I have added support for SAMD architecture type boards (Arduino MKR)

This modified code should behave the same on AVR boards as previously & add support for all SAMD architecutre micro controller boards. When this pull request is merged, it would be great to also modify the compatibility in the Arduino Library manager to include the SAMD architecture / MKR family boards.

Best wishes, Simon

PaulStoffregen commented 4 weeks ago

Is this ready to be merged? Or still adding more commits?

simon-77 commented 4 weeks ago

This is ready to be merged, thank you for asking.

The first 4 commits where the "minimal" changes I made to the original code while adding compatibility for the MKR family.

I then added (with 2 additional) commits the ability to configure RX & TX pins via constructor for the MKR family, for which I have introduced 2 new static variables, which are default-initialized to the defines which are in use for the AVR microcontrollers, to keep everything compatible. I did not consider that making further changes to my fork after creating the pull request would update it as well. Therefore depend on your choice you can also only merge the first 4 commits (2f7fc02), although I think that the configurable RX & TX pins for the MKR family are a nice feature too.

Two more notes:

Cheers Simon