Making libraries work for Photon AND Core?

You can look here

But if you use digitalReadFast() pinReadFast(), digitalWriteFast(), pinSetFast() and pinResetFast() instead of the hardware specific alternatives you may even get away without these.