findphone tweak to code
parent
6817cafba4
commit
eb8d9940dd
|
|
@ -19,10 +19,14 @@ function draw() {
|
||||||
g.flip();
|
g.flip();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function findPhone(v) {
|
||||||
|
Bluetooth.println(JSON.stringify({t:"findPhone", n:v}));
|
||||||
|
}
|
||||||
|
|
||||||
function find(){
|
function find(){
|
||||||
finding = !finding;
|
finding = !finding;
|
||||||
draw();
|
draw();
|
||||||
Bluetooth.println("\n"+JSON.stringify({t:"findPhone", n:finding}));
|
findPhone(finding);
|
||||||
}
|
}
|
||||||
|
|
||||||
draw();
|
draw();
|
||||||
|
|
@ -43,12 +47,9 @@ if (process.env.HWVERSION == 2) {
|
||||||
// click top part of the screen to stop start
|
// click top part of the screen to stop start
|
||||||
if (xy.y < g.getHeight() / 2) {
|
if (xy.y < g.getHeight() / 2) {
|
||||||
find();
|
find();
|
||||||
return;
|
|
||||||
} else {
|
} else {
|
||||||
// exit app
|
findPhone(false);
|
||||||
Bluetooth.println("\n"+JSON.stringify({t:"findPhone", n:false}));
|
setTimeout(load, 100); // exit in 100ms
|
||||||
load();
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue