You are reading a single comment by @HughB and its replies. Click here to read the full conversation.
  • Thanks for that, that worked.

    I have been testing the next iteration.
    I have noticed that after I have hada fix that after swiping out of the clock_info back to say the battery display that the GPS gets powered on again.

    My question is:

      var timeout;   // is this the same variable as
    
            hide: function() {
              Bangle.setGPSPower(0,"clkinfo");
              Bangle.removeListener("GPS", onGPS);
              if (this.timeout) {
                clearTimeout(this.timeout);  /// <<<<  as the variable here ?
                this.timeout = undefined;
              }
              resetLastFix();
            }
    

    I'm not 100% sure I understand how this.timeout gets defined in code at:

    https://github.com/espruino/BangleApps/b­lob/master/apps/clock_info/lib.js
    line 83

          hide : function() {
            Bangle.setHRMPower(0,"clkinfo");
            Bangle.removeListener("HRM", hrmUpdateHandler);
            if (this.timeout) {
              clearTimeout(this.timeout);
              this.timeout = undefined;   //////  where does timeout get declared, just seems to spring into existance
            }
            hrm = 0;
          },
        }
    
    
About

Avatar for HughB @HughB started