Pausing application using sleep mode on electron without wakeup- Pin

Hello, I have a query regarding sleep mode on Particle electron. The docs describe sleep mode in detail as per the following link.
https://docs.particle.io/reference/firmware/electron/#sleep-sleep-

It mentions that using System.sleep(SLEEP_MODE_DEEP, seconds, SLEEP_NETWORK_STANDBY) turns off microcontroller and using System.sleep(wakeUpPin, edgeTriggerMode, seconds, SLEEP_NETWORK_STANDBY) pauses application on the microcontroller till an interrupt is triggered or timeout is over.

I wanted to know if it is possible to pause the application without specifying a wakeup-pin. What would be the sleep call for that? I don’t want to use deep sleep mode as I don’t want to turn microcontroller off and I also don’t want to turn off cellular. I want to pause it and resume after a specified time period.

Not tested, but how about assigning a non-existant pin as wake-pin (e.g. -1)?
On the other hand what’s the problem with just assigning an unused pin?

1 Like

@scruffR if I assign a non-existent pin, how will I be able to change its state to cause interrrupt i.e. rising/falling/change. The thing with unused pin is that for the application I’m working on, we have used almost all the pins and we may want to use the ones that are left, in future. So then it could create a problem for us.

I thought that is what you (implicitly) wanted when you said

A non-existing pin won’t change its state and hence won’t wake the device with and interrupt and consequently the only wake will be time-triggered.[quote=“Oizom_dev, post:3, topic:37006”]
The thing with unused pin is that for the application I’m working on, we have used almost all the pins and we may want to use the ones that are left, in future.
[/quote]

Does this include the BTN “pin”?
This is the name for the GPIO that is tied to the the SETUP button. If you go for a FALLING edge trigger, you can even use it to wake the device.

1 Like

@ScruffR Oh yes right! That idea didn’t cross my mind. I’ll definitely try it out and see if that works. Also, BTN pin is not included as of now so I’ll try that too. Thanks so much!

1 Like