🤖Have you ever tried Chat.M5Stack.com before asking??😎
    M5Stack Community
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Register
    • Login

    Resume program at position after sleep mode?

    General
    1
    2
    3.7k
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • G
      Gero Nimo
      last edited by

      Hi,
      I have a rather big program that has quite a few functions. I would also like to save some battery and therefore I want to send my M5Stack into sleep mode.

      Program start;
      execute SETUP() once: function A(), function B(), C();

      LOOP(): function D(), function E(), START HERE SLEEP.

      When sleep is over, my program starts again at the beginning executing the SETUP() function. Is there any way to resume my program where it stopped? Like with the next line of code or with the next function? I do not want to start again at setup().

      LOOP(): function D(), function E(), START HERE SLEEP; Wake up from sleep; Resume with function F(), function G(). Start again with LOOP() function D(), E(), sleep,...

      1 Reply Last reply Reply Quote 0
      • G
        Gero Nimo
        last edited by

        light sleep should do the job, but I have to do some testing.

        Are there any data or "connections" lost after you wake up from light sleep?

        1 Reply Last reply Reply Quote 0
        • First post
          Last post