I noticed a funny problem If you call ui.setFrames(...) and your
device has been running for more than about 33 seconds, the display would
seem to lock-up and stop updating for up to 30ish seconds. The root cause
was that when state gets reset state.lastUpdate becomes zero and therefore
the math to calculate time budget can be bigger than what can be
represented in a 16 bit int. If you are unlucky your negative number
will be thought to be a large postive number and the display drawing would
get skipped.
This fixes that by keeping timeBudget as an int32 (which is 'free'
because it probably in a register anyways...)
I noticed a funny problem If you call ui.setFrames(...) and your device has been running for more than about 33 seconds, the display would seem to lock-up and stop updating for up to 30ish seconds. The root cause was that when state gets reset state.lastUpdate becomes zero and therefore the math to calculate time budget can be bigger than what can be represented in a 16 bit int. If you are unlucky your negative number will be thought to be a large postive number and the display drawing would get skipped.
This fixes that by keeping timeBudget as an int32 (which is 'free' because it probably in a register anyways...)