• That's great!

    I want to display a message while the GPS is powered on , setup and then powered off.

    What is the wait function? If it's what I think it is, it's best to totally avoid those - if the function actually waits for 500ms, that stops Espruino from handling any data that comes in, which will probably cause buffer overflows.

    However if wait uses setTimeout then you'll find that the code drops through immediately and displays your message and then maybe clears it right after. I'd say what you really need is something like:

    function exitSetup() {
      log_debug("exitSetup()");
      if (settings_changed) {
        log_debug(settings);
        g.clear();
        g.setFontAlign(0,0);
        g.setColor(3);  
        g.setFontVector(25);
        g.drawString("Configuring GPS",120,120);
        setTimeout(function() {
          setupGPS();
          setTimeout(function() { load() }, 500);
       }, 500);
      } else load();
    }
    

    Also, just FYI but you can also just do E.showMessage("Configuring GPS") - it's a helper function for this sort of thing.

About

Avatar for Gordon @Gordon started