Blob clock tweaks
parent
668aa08fb6
commit
fbb18d1128
|
|
@ -627,7 +627,7 @@
|
||||||
{ "id": "blobclk",
|
{ "id": "blobclk",
|
||||||
"name": "Large Digit Clock",
|
"name": "Large Digit Clock",
|
||||||
"icon": "clock-blob.png",
|
"icon": "clock-blob.png",
|
||||||
"version":"0.01",
|
"version":"0.02",
|
||||||
"description": "A clock with big digits",
|
"description": "A clock with big digits",
|
||||||
"tags": "clock",
|
"tags": "clock",
|
||||||
"type":"clock",
|
"type":"clock",
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,3 @@
|
||||||
|
0.02: Improve performance when screen wakes
|
||||||
|
Only draw widgets after clearing screen - they update automatically
|
||||||
|
Remove 'faceUp' check as it's automatic
|
||||||
|
|
@ -17,7 +17,6 @@
|
||||||
function flip() {
|
function flip() {
|
||||||
g.setColor(1,1,1);
|
g.setColor(1,1,1);
|
||||||
g.drawImage({width:buf.getWidth(),height:buf.getHeight(),buffer:buf.buffer},55,26);
|
g.drawImage({width:buf.getWidth(),height:buf.getHeight(),buffer:buf.buffer},55,26);
|
||||||
try { if (drawWidgets) { drawWidgets();} } catch(err) {}
|
|
||||||
}
|
}
|
||||||
function drawPixel(ox,oy,x,y,r,p) {
|
function drawPixel(ox,oy,x,y,r,p) {
|
||||||
let x1 = ox+x*(r*2+1);
|
let x1 = ox+x*(r*2+1);
|
||||||
|
|
@ -81,28 +80,23 @@
|
||||||
flip();
|
flip();
|
||||||
}
|
}
|
||||||
function clearTimers() {
|
function clearTimers() {
|
||||||
if(intervalRef) {clearInterval(intervalRef);}
|
if(intervalRef) {
|
||||||
|
clearInterval(intervalRef);
|
||||||
|
intervalRef = undefined;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
function startTimers() {
|
function startTimers() {
|
||||||
g.clear();
|
g.clear();
|
||||||
digits = [-1,-1,-1,-1,-1,-1];
|
try { if (drawWidgets) { drawWidgets();} } catch(err) {}
|
||||||
intervalRef = setInterval(redraw,1000);
|
intervalRef = setInterval(redraw,1000);
|
||||||
redraw();
|
redraw();
|
||||||
}
|
}
|
||||||
startTimers();
|
startTimers();
|
||||||
Bangle.on('lcdPower',function(on) {
|
Bangle.on('lcdPower',function(on) {
|
||||||
if (on) {
|
if (on) {
|
||||||
g.clear();
|
|
||||||
startTimers();
|
startTimers();
|
||||||
try { if (drawWidgets) { drawWidgets();} } catch(err) {}
|
|
||||||
} else {
|
} else {
|
||||||
clearTimers();
|
clearTimers();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
Bangle.on('faceUp',function(up){
|
|
||||||
if (up && !Bangle.isLCDOn()) {
|
|
||||||
clearTimers();
|
|
||||||
Bangle.setLCDPower(true);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
})();
|
})();
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue