mirror of https://github.com/espruino/BangleApps
runplus: factor out to `setScreen`
parent
8bc3b49e80
commit
84730da57a
|
@ -192,11 +192,15 @@ run();
|
||||||
|
|
||||||
function karvonen(){
|
function karvonen(){
|
||||||
// stop updating and drawing the traditional run app UI
|
// stop updating and drawing the traditional run app UI
|
||||||
|
setScreen("karvonen");
|
||||||
|
require("runplus_karvonen").start(settings.HRM, exs.stats.bpm);
|
||||||
|
}
|
||||||
|
|
||||||
|
function setScreen(to) {
|
||||||
if (runInterval) clearInterval(runInterval);
|
if (runInterval) clearInterval(runInterval);
|
||||||
runInterval = undefined;
|
runInterval = undefined;
|
||||||
g.reset().clearRect(Bangle.appRect);
|
g.reset().clearRect(Bangle.appRect);
|
||||||
require("runplus_karvonen").start(settings.HRM, exs.stats.bpm);
|
screen = to;
|
||||||
screen = "karvonen";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Define the function to go back and forth between the different UI's
|
// Define the function to go back and forth between the different UI's
|
||||||
|
|
Loading…
Reference in New Issue