Addressing review comments
parent
15a92c1b38
commit
bc4a05e314
|
|
@ -9,6 +9,8 @@ let hour;
|
||||||
let minute;
|
let minute;
|
||||||
let date;
|
let date;
|
||||||
|
|
||||||
|
let timer;
|
||||||
|
|
||||||
function draw() {
|
function draw() {
|
||||||
const d = new Date();
|
const d = new Date();
|
||||||
|
|
||||||
|
|
@ -51,7 +53,6 @@ function drawAll() {
|
||||||
minute = '';
|
minute = '';
|
||||||
date = '';
|
date = '';
|
||||||
g.drawImage(bob, 0, 0, { scale: 4 });
|
g.drawImage(bob, 0, 0, { scale: 4 });
|
||||||
Bangle.loadWidgets();
|
|
||||||
Bangle.drawWidgets();
|
Bangle.drawWidgets();
|
||||||
draw();
|
draw();
|
||||||
}
|
}
|
||||||
|
|
@ -59,10 +60,13 @@ function drawAll() {
|
||||||
Bangle.on('lcdPower', function(on) {
|
Bangle.on('lcdPower', function(on) {
|
||||||
if (on) {
|
if (on) {
|
||||||
drawAll();
|
drawAll();
|
||||||
|
timer = setInterval(draw, 1000);
|
||||||
|
} else if (timer) {
|
||||||
|
clearInterval(timer);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
setInterval(draw, 1000);
|
Bangle.loadWidgets();
|
||||||
drawAll();
|
drawAll();
|
||||||
|
|
||||||
setWatch(Bangle.showLauncher, BTN2, { repeat: false, edge: 'falling' });
|
setWatch(Bangle.showLauncher, BTN2, { repeat: false, edge: 'falling' });
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue