For my photon based project I used the following 2 community libraries:
Adafruit_mfGFX
Adafruit_ILI9341
I ended up in forking both and had to do only a few changes to make them work on the Photon. Now I am looking for a possibility to make these changes in a way that the same library works on a photon and on a core. Once that is done I want submit a Pull Request to get the changes back into the original repository.
What I am looking for is some hints how to accomplish that. From my point of view I only need a preprocessor macro to distinguish between the 2 platforms. Do such macros exist ? Am I on the right track ?
But if you use digitalReadFast()pinReadFast(), digitalWriteFast(), pinSetFast() and pinResetFast() instead of the hardware specific alternatives you may even get away without these.
@ScruffR, I believe the command is pinReadFast(). That’s my doing! I’m going to post a PR to rename digitalReadFast() or add digitalReadFast() which makes more sense IMO. Or simply, you could also add a `#define digitalReadFast(pin) pinReadFast(pin) to any app.
Note that these are ONLY available on the Core and Photon firmware versions 0.4.6 and later.
Doh’, should have double checked - thanks Paul for setting that right.
Yes, it would make more sense if the naming went in line with the standard functions.
But about the versions I think the version when it was introduced on Photon is 0.4.3 (pinReadFast 0.4.4) and for the Core 0.4.5 (at least Web IDE does build with these versions).