1
0
Fork 0

score: keep display powered on

master
Mika Dede 2021-10-10 17:27:50 +02:00
parent f6f1a1c352
commit f5fefc7c99
No known key found for this signature in database
GPG Key ID: 546586DC38D45BBD
1 changed files with 8 additions and 1 deletions

View File

@ -19,6 +19,8 @@ let correctionMode = false;
let w = g.getWidth(); let w = g.getWidth();
let h = g.getHeight(); let h = g.getHeight();
let isBangle1 = process.env.BOARD === 'BANGLEJS';
function getXCoord(func) { function getXCoord(func) {
let offset = 40; let offset = 40;
return func(w-offset)+offset; return func(w-offset)+offset;
@ -29,7 +31,6 @@ function getSecondsTime() {
} }
function setupInputWatchers(init) { function setupInputWatchers(init) {
isBangle1 = process.env.BOARD === 'BANGLEJS';
Bangle.setUI('updown', v => { Bangle.setUI('updown', v => {
if (v) { if (v) {
if (isBangle1) { if (isBangle1) {
@ -458,6 +459,12 @@ function draw() {
g.flip(); g.flip();
} }
// make sure LCD on Bangle.js 1 stays on
if (isBangle1) {
Bangle.setLCDTimeout(0);
Bangle.setLCDPower(true);
}
setupInputWatchers(true); setupInputWatchers(true);
setupMatch(); setupMatch();
draw(); draw();