Pinoccio/library-pinoccio — pull request #149 by matthijskooijman (2014-06-30 20:03:15+00:00)
Title: Use the symbol counter for sleeping

This uses the symbol counter for sleeping, increasing the accuracy of the sleep duration, as well as allowing reliable timekeeping across sleeps (at the cost of reducing the maximum sleep time to 19 hours and reducing the PWM frequency of the blue led to 128Hz).

This change breaks the `uptime.millis.sleep` counter. I was planning to calculate this from `uptime.millis` - `uptime.millis.awake`, but both have a different overflow range (2^32 ms for `millis()` / `uptime.millis.awake`, 2^32 * 16 us for `uptime.millis.sleep`, which are not interdivisible either), which makes things a bit more complicated.