arduino-libraries / ArduinoRS485

GNU Lesser General Public License v2.1
88 stars 68 forks source link

default pin #defines acting wrong? #32

Open albinotoni opened 1 year ago

albinotoni commented 1 year ago

Hi!

I followed some dmx-tutorial and wired my nano to pins A5 and A6 which are and were working great. Then I added an interrupt to the code with incoming pin 2 and it didn't work out with the this library anymore. I fixed the thing by commenting out definitions inside the #ifdef AVR part on the rs485.h and replacing the pins with A5 and A6 (like they are again underneath) and now I think everything works pretty much as they should on nano. I just really don't understand at this point, how did the dmx work earlier with A5 and A6?

wohali commented 1 year ago

Similar problem, except for Raspberry Pi Pico - which does not have A5 or A6 in the pin mapping, only pins named p0...p29.

Without overriding RS485.h manually, this library cannot be used with the Pico because those pins are not defined in the Pico's PinNames.h.

wohali commented 1 year ago

It would be helpful if you could wrap the RS485_DEFAULT_DE_PIN and RS485_DEFAULT_RE_PIN #defines in #ifndefs.

Then, we could set -DRS485_DEFAULT_DE_PIN=whatever and -DRS485_DEFAULT_RE_PIN=whatever in a project build file.