You are reading a single comment by @Gordon and its replies. Click here to read the full conversation.
  • is this var timeout the same variable as this.timeout

    Nope :)

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

    It's defined in .run just a few lines earlier: https://github.com/espruino/BangleApps/b­lob/master/apps/clock_info/lib.js#L83

    run : function() {
            Bangle.setHRMPower(1,"clkinfo");
            if (settings.hrmOn==1/*Tap*/) {
              /* turn off after 1 minute. If Health HRM monitoring is
              enabled we will still get HRM events every so often */
              this.timeout = setTimeout(function() {
                this.timeout = undefined;
                Bangle.setHRMPower(0,"clkinfo");
              }, 60000);
            }
          },
    
About

Avatar for Gordon @Gordon started