Photon Sleep Protocol

I’m having a hard time finding documentation or forum threads that discuss exactly how the Photon reacts to System.sleep(uint16_t wakeUpPin, uint16_t edgeTriggerMode). I’m running 0.4.6 firmware - just upgraded yesterday. Three questions:

  1. Does this call put the system into deep sleep or light sleep - it’s not clear since the argument to choose is missing from this call, while present in others. I believe it’s a deep sleep - the doc seems to indicate that, but am not sure.

  2. When this call is in effect, what is the effect of pulling the WKP pin HIGH on the Photon? Regardless of the state of the selected wakeUpPin, does WKP also wake the system up?

  3. When the wakeUpPin is triggered - does the loop() continue with the next statement after the sleep call, or does it begin with the setup routine again? Again, the docs to not talk to this aspect of the sleep call, but the behavior I’ve observed is that the system wakes up and begin execution with the statement following sleep.

Thanks in advance,
John

There is an open issue on GitHub
https://github.com/spark/firmware/issues/655

And about the sleep modes once they are working
https://docs.particle.io/reference/firmware/photon/#system-sleep-

And even better in the GitHub sources (comments at line 340ff: Low Power modes configuration functions)
https://github.com/spark/firmware/blob/develop/platform/MCU/STM32F2xx/STM32_StdPeriph_Driver/src/stm32f2xx_pwr.c

The docs do say:

Where "registers" also includes stack and instruction pointer, so the program flow will continue with the next instruction after sleep()
But since this is not as clear as it could be another GitHub issue was already opened too.