"Soft" Reset Pin 1 - Stuck Imp?

Before my question is validated, let me ensure I understand the background properly. On the Imp, using Pin 1 as a reset, you can set the “reset” to high or low (meaning “soft”). Normally a reset pin is a “hard”, in that its standard state can not be changed.

My concern then is, if the reset pin is “soft” can the Imp get stuck in some weird state where there isn’t code tell if high or low is reset? Then the Imp may get stuck on or off.

Is my understanding correct? Is this possible?

Pin1 is not a reset pin. It can (optionally) wake the imp from deep sleep (active high). It never resets the imp while it’s awake.

Peter

I think we’re on the same page, I may be asking this question in an odd way.

Pin1 is used for waking the imp. Which we do. We pull Pin1 high to wake the Imp.

But my concern is that, we do this all in code, what if the Imp doesn’t know high means wake up cause it doesn’t have the code?

Pin 1 will only wake it up from “deep sleep”, and will make it reload the code and start again from the beginning of the code.

“Deep sleep” is a state that you have created by using imp.deepsleepfor(seconds), and before that you must configure pin1 as an input of type DIGITAL_IN_WAKEUP. It remembers this state (and the nv ram) even though it is in micropower mode and no code is running, as long as power is maintained. Note that when you wake it with pin1 high, it will reload code, so pin1 may have gone low again by the time your code is running. To get round this you need to check hardware.wakereason() and see if you have WAKEREASON_PIN1.

If you remove power, it forgets everything, and on applying power again the imp will just load and run its code again, with a wakereason of WAKEREASON_POWER_ON.