Guys,
I'm seeing this:
extern const uint8_t digital_pin_to_pcint[]; // this extern needed for mighty-1284p core support
show up in code. Like SoftwareSerial and the GSM libraries.
To me this is wrong. This is an extern to support some macros like
digitalPinToPCICRbit(p)
digitalPinToPCMSK(p)
digitalPinToPCMSKbit(p)
The code that uses those macros should have no knowledge about their internal implementation
and shouldn't have to do special things to make them work.
So in my view the extern declaration should be in pins_arduino.h where the macro definition is.
i.e. the pins_arduino.h should do whatever it takes to make the macros/functions it uses & defines
work and that should also include declaring extern references when needed.
Was it just an "oops" or is there some reason why this wasn't done in pins_arduino.h?
Given that this extern declaration is the only change to SoftwareSerial, if the extern is moved to pins_arduino.h
then a patched version of SoftwareSerial wouldn't be needed.
Another issue I'm seeing is that these patched libraries are interfering with other patched libraries.
For example, the Teensy install modifies some libraries. SoftwareSerial is one of the libraries that Teensy modifies.
So if you have Teensy installed and then try to copy/install the patched 1284 patched SoftwareSerial,
you overwrite/replaced the SoftSerial with Teensy support.
I think at least for SoftSerial, that if pins_arduino.h could be updated to include the extern for digital_pin_to_pcint[]
that this specific issue will go away.
But this is hinting at the issue I was concerned about: supporting patched libraries.
It is a very large task with almost no boundaries.
--- bill