Is there a function that capture what triggered the application to run. Was it on_interval or a gpios that woke up the device? I'm trying to capture the event so I can run a specific function if the device is woke up by gpios interrupt.
Can't remember if there is something similar in v1.
floitsch06/03/2023 09:44 PM
In the worst case you could start different programs with different triggers and then start the main app with a pubsub message that contains the wakeup cause.
bitphlipphar06/04/2023 05:50 AM
If I remember correctly, it is something like this on Toit v1:
import job
main:
if job.trigger is job.GpioTrigger:
print "Got started by GPIO interrupt"(edited)
import job etc. works like a charm. Now I just need to make the device go to deep sleep again, and in version 1 import esp32 is not available. Do you have a library containing this function?
OPPeterJ
import job etc. works like a charm. Now I just need to make the device go to deep sleep again, and in version 1 import esp32 is not available. Do you have a library containing thi...
floitsch06/04/2023 08:14 PM
V1 (as well as Artemis) automatically go to deep sleep when no program is running and max-offline is > 0.