Ok, I added this. It is not fully supporting the syntax of the Photon, in other words, you cannot call the all in one command:
System.sleep(uint16_t wakeUpPin, uint16_t edgeTriggerMode);
Instead, you need to set an interrupt in setup() as such:
attachInterrupt(D2, nothing, FALLING);
Then, when you are ready to sleep:
This will set D2 with a PULLUP and trigger the wakeup on the FALLING edge. If you want to reverse this you can set a PULLDOWN and wake on a RISING edge.
I will work on getting the better option working so you can just call:
It may just take a bit longer