What the Fenix?

Pretty sure something isn't right here:

From the device PRF file. Watch face is continuing to tick away like nothing is wrong.

Another week, a new bug.

Good tools do work, bad tools make work.

  • Have you used "View Watchface Diagnostics" in the sim?  That's the tool for onPartialUpdate. Switch to low power in the sim and run it

    The rules is that over 1 minute, the avg time for the calls have to be <30ms.  While if you are at 29ms, things run, but you pay the price in battery.  I tend to be closer to 10ms with mine.

    The size of the area you update has an impact on the time - The number of rows is the big factor..  If you have multiple clip regions, they are combined, so the area is the top of the top clip region to the bottom of the lowest clip region.

    Here's an example of one of my watch faces in the sim for the f7.  It only updates the seconds.  10.695ms

    .

  • In sim diagnostics it's currently less than 10ms,  up until recently per the watch PRF it was less than 6 ms. The sim and watch don't match, I've posted on this before. It's an analog watch face, so the one clipping region size varies by the second. I've been trying to tweak time and code size with the hopes of getting it to run on more devices, and apparently I broke something. Now it's all sideways. FWIW, it runs on my FR235 so maybe space isn't such an issue, but because there aren't any seconds it's not really a direct comparison. However, it seems like a number around 2**32 should be suspicious and maybe indicate something wrong with more than just user code.

  • With an analog face, the average won't be 10ms unless you have a really small second hand.  If you watch the diagnostics, you'll see the time is lowest at 3 and 9, and highest at 6 and 12 (the number of rows comes into play).  What you see in diagnostics isn't the average, but the value for the last time onPartialUpdate was called, so it keeps changing.

  • Here's where I was 10 days ago:

    Here's the second hand between the hour and minute hand and some other stuff on the face like steps and the tides. I'm not sure what you think is small but this goes to the edge of the watch face:

    Each hand is two separate polygons and onPartiaUpdate is drawing the second hand. Adding up the functions that onPartialUpdate calls the times seem where I would expect, but for some reason the total doesn't equal the sum of the parts.

  • There appears to be a "feature" in the watch firmware because the PRF files look like they have some corruption:

    AnnulusFace.fillHand does what it sounds like, draws two polygons to make a hand. It is only ever called in onUpdate or onPartialUpdate, so why is it in the background PRF? Also, getURL is this:

    	public function getURL(php, rest) {
    		return _getURL + php + "/" + _uID + "_" + System.getTimer() + "_" + _getRetrys + "/" + rest;
    	}
    

    So why does it take 1.4 seconds to build a string, or are string operations really that bad?

    At least the time for onPartialUpdate is back to a believable valure:

    Looks like some sort of weird firmware bug unless someone can offer a better explanation.

  • This appears to be an integer overflow issue. Would you happen to have some code / CIQ project you could share that reliably reproduces this?

  • It's not consistent. I see it in the simulator too.

    Could it be because of this?

    Or this?

    As I look at it I'm thinking underflow but being displayed as unsigned.

  • It's basically straight from the analog watch sample:

        public function getInitialView() as [Views] or [Views, InputDelegates] {  // SDK 7+
            var wView = new AnnulusWatch();
            if (WatchUi has :WatchFaceDelegate) {
                var wDelegate = new AnnulusDelegate(wView);
                return [wView, wDelegate];
            } else {
                return [wView];
            }
        }