Update golf-gps.js

pull/3467/head
jeonlab 2024-06-24 12:45:28 -04:00 committed by GitHub
parent 2ba7c3d2d9
commit 912354f96b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 8 additions and 2 deletions

View File

@ -99,6 +99,11 @@ function mainMenu() {
});
}
function backToClock() {
NRF.wake();
load();
}
function browseScore() {
const scoreFiles = require("Storage").list(/^Scorecard-/);
if (scoreFiles.length === 0) {
@ -108,7 +113,7 @@ function browseScore() {
"END": 1
}
}).then(choice => {
if (choice === 1) load();
if (choice === 1) backToClock();
});
}
let fileIndx = scoreFiles.length - 1;
@ -126,7 +131,7 @@ function browseScore() {
}).then(choice => {
if (choice === 1) fileIndx = (fileIndx - 1 + scoreFiles.length) % scoreFiles.length;
else if (choice === 2) fileIndx = (fileIndx + 1) % scoreFiles.length;
else if (choice === 3) load();
else if (choice === 3) backToClock();
browseFiles();
});
}
@ -134,6 +139,7 @@ function browseScore() {
}
function fixGPS() {
NRF.sleep();
Bangle.on('GPS', onGPS);
Bangle.setGPSPower(1, "golf-gps");
E.showMessage("Golf GPS v0.1\n\nWaiting for GPS fix...\n\nwritten by\nJinseok Jeon\n\n ");