MichaelJonker / HardwareSerialRS485

Arduino Software for RS485 support with collision detection and message handling capabilities
MIT License
107 stars 29 forks source link

Update HardwareSerialRS485_Helper.h for all possible ports #8

Open atehxx opened 6 years ago

atehxx commented 6 years ago

Added more ports (now matches also ArduinoMega) Changed TRx_PORT and DDR type to uint16_t to allow all ports of Arduino Mega (e.g. PORTH)

MichaelJonker commented 6 years ago

Hi thanks for your contribution. I am momentarily away with reduced access. I will look at your PR and integrate it next week (after testing that it does not break existing code). M

atehxx commented 6 years ago

No problem. I tested this on Arduino Mega, on Uno, and on Atmega644PA standalone chip (with arduino core added). Also there was your comment "TODO try a cleanup with a consexpr function, i.e. a function that is evaluated at compile time." this doesn't seem to be needed - I was checking compiled code and it already evaluates and compiles to final registry. uint16_t here is needed as some ports on Mega have 2 byte address, but it's enough to change it here only - I spent 2 days taking my hairs off why this library doesn't work... I was using port H :D