Is there a way for the device (Photon) to know it has been reset

Hi All,

Is there a way for the device to know it has been reset, after reset? I saw examples of how to catch the reset pin while running, but nothing to catch it after reset?

I’m asking because I’m working on a project for Photon on Power Shield where the device will be asleep (deep sleep), for most of the time, but it would be nice to let it stay on for ~30s extra if it just booted from reset so that I could flash OTA. (Thinking about something I could check during setup, and include a delay if reset.)

Alternatively, if the device is in deep sleep, will the event handler for the reset pin still trigger, or will the device just reset (my guess, the latter)?

Thanks!

Hmm, how about the docs?
https://docs.particle.io/reference/firmware/photon/#reset-reason

3 Likes

Thanks @ScruffR, that was exactly what I was looking for!

1 Like