You are reading a single comment by @Gordon and its replies. Click here to read the full conversation.
  • IMO that code should really go into jshSleep - if you look at the STM32 port it basically does:

    void jshSleep(time) {
      if (deepSleepEnabled) {
        deep_sleep(time);
      } else {
        normal_sleep(time);
      }
    }
    

    I know it's a bit different in ESP8266, but it should still be possible to sleep in there - and then it behaves the same as other Espruino devices. You just call setDeepSleep(1) and from then on it does deep sleep whenever it can.

About

Avatar for Gordon @Gordon started