The problem is, some clockinfos (eg the 'height' one) can't get the data they need to draw immediately.
So the idea was that you'd call show, and that turns on the barometer, takes a reading, and they redraws when it has one.
We need show/hide because we don't want to turn on gps/hrm/barometer/etc all the time - we just want them when the info is showing.
We also don't want to redraw the clock infos every minute/second - we want them to be able to tell us when they changed and want to redraw.
The show : function() {this.emit("redraw");} case I think is probably not right - we should probably draw all clockinfos immediately and then the clockinfo calls emit if it didn't have the right data for the first draw call/
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
The problem is, some clockinfos (eg the 'height' one) can't get the data they need to draw immediately.
So the idea was that you'd call
show
, and that turns on the barometer, takes a reading, and they redraws when it has one.We need show/hide because we don't want to turn on gps/hrm/barometer/etc all the time - we just want them when the info is showing.
We also don't want to redraw the clock infos every minute/second - we want them to be able to tell us when they changed and want to redraw.
The
show : function() {this.emit("redraw");}
case I think is probably not right - we should probably draw all clockinfos immediately and then the clockinfo calls emit if it didn't have the right data for the first draw call/