You are reading a single comment by @skm and its replies. Click here to read the full conversation.
  • I have been wrestling with my app mysteriously hanging, requiring a long press of BTNs 1 and 2, and believe I have tracked the problem down to Bangle.drawWidgets. It happens randomly and I have only ever seen it happen when both GPS and HRM power are enabled. The widgets I currently have loaded are Bluetooth Widget, Battery Level Widget (with percentage) and RAM Widget. The following code demonstrates the problem:

    var ctr = 0;
    g.clear();
    Bangle.loadWidgets();
    Bangle.drawWidgets();
    Bangle.setGPSPower(1);
    Bangle.setHRMPower(1);
    setInterval(function(){
      g.reset();
      g.setFont("6x8", 3);
      g.drawString(ctr.toString(),60,60,true);­
      if(ctr++%10 == 0){
        g.reset();
        Bangle.drawWidgets();
      }
      g.flip();
    },100);
    

    When it hangs, which can take anywhere up to an hour, the count is always a multiple of 10 (e.g. 16140 in my final test just now) - hence my assertion that drawWidgets is triggering the problem - and the only widget remaining visible is the bluetooth symbol. The app hangs on both the current stable firmware and bleeding edge. Nothing is logged on the console and memory usage (when running test code above) was stable at 22%.

About

Avatar for skm @skm started