Skip to content

Commit

Permalink
[] skyspy: only use fake data on emulator.
Browse files Browse the repository at this point in the history
  • Loading branch information
pavelmachek committed Jun 19, 2024
1 parent 49d416b commit bb300af
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions apps/skyspy/skyspy.app.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
/* Sky spy */
/* Sky spy */

let libgps = {
emulator: -1,
init: function(x) {
this.emulator = (process.env.BOARD=="EMSCRIPTEN"
|| process.env.BOARD=="EMSCRIPTEN2")?1:0;
},
state: {},
/* 0 .. DD.ddddd
1 .. DD MM.mmm'
Expand Down Expand Up @@ -50,7 +55,8 @@ let libgps = {
clearTimeout(gps_state.timeout);
},
getGPSFix: function() {
if (0) Bangle.getGPSFix();
if (!this.emulator)
return Bangle.getGPSFix();
let fix = {};
fix.fix = 1;
fix.lat = 50;
Expand Down Expand Up @@ -130,7 +136,7 @@ function updateGps() {

speed = getTime() - gps_start;

print(fix);
//print(fix);
if (fix && fix.fix && fix.lat) {
lat = "" + libgps.format(fix.lat);
lon = "" + libgps.format(fix.lon);
Expand Down Expand Up @@ -325,6 +331,7 @@ function touchHandler(d) {
nextScreen();
}

libgps.init();

Bangle.on("drag", touchHandler);
Bangle.setUI({
Expand Down

0 comments on commit bb300af

Please sign in to comment.