Skip to content

Commit f799d77

Browse files
committed
waypoints: cleanups, use gps handling from library
1 parent 33a8e76 commit f799d77

File tree

1 file changed

+5
-10
lines changed

1 file changed

+5
-10
lines changed

apps/waypoints/waypoints.app.js

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -394,7 +394,7 @@ function updateGoto() {
394394

395395
function stopGps() {
396396
cancel_gps = true;
397-
Bangle.setGPSPower(0, "waypoints");
397+
gps.stop_gps();
398398
}
399399

400400
function confirmGps(s) {
@@ -418,7 +418,7 @@ function confirmGps(s) {
418418

419419
function markGps() {
420420
cancel_gps = false;
421-
Bangle.setGPSPower(1, "waypoints");
421+
gps.start_gps();
422422
require("textinput").input({text:"wp"}).then(key => {
423423
confirmGps(key);
424424
});
@@ -494,8 +494,7 @@ function showNumpad(text, key_, callback) {
494494

495495
function goTo() {
496496
cancel_gps = false;
497-
Bangle.setGPSPower(1, "waypoints");
498-
gps.gps_start = getTime();
497+
gps.start_gps();
499498

500499
var la = new Layout (
501500
{type:"v", c: [
@@ -557,10 +556,8 @@ function remove(c) {
557556
if (v) {
558557
wp.splice(c, 1);
559558
writeWP();
560-
mainMenu();
561-
} else {
562-
mainMenu();
563559
}
560+
mainMenu();
564561
});
565562
}
566563

@@ -590,10 +587,7 @@ function ask01(t, cb) {
590587
la.render();
591588
}
592589

593-
var res;
594-
595590
function askCoordinate(t1, t2, callback) {
596-
//let sign = 1;
597591
ask01(t1, function(sign) {
598592
let d, m, s;
599593
switch (fmt.geo_mode) {
@@ -602,6 +596,7 @@ function askCoordinate(t1, t2, callback) {
602596
case 2: s = "DDD MM'ss"+'"'; break;
603597
}
604598
showNumpad(s, t2, function() {
599+
let res = 0;
605600
switch (fmt.geo_mode) {
606601
case 0:
607602
res = parseFloat(key);

0 commit comments

Comments
 (0)