2021-04-14 21:54:01 +00:00
|
|
|
(() => {
|
|
|
|
function getFace(){
|
|
|
|
let swObject = undefined;
|
|
|
|
|
2021-05-08 12:32:37 +00:00
|
|
|
function init(gps, sw, hrm) {
|
2021-04-14 21:54:01 +00:00
|
|
|
swObject = sw;
|
|
|
|
g.clear();
|
|
|
|
}
|
|
|
|
|
2021-04-18 11:28:13 +00:00
|
|
|
function freeResources() {}
|
2021-04-14 21:54:01 +00:00
|
|
|
|
|
|
|
function startTimer() {
|
|
|
|
swObject.startTimer();
|
|
|
|
}
|
|
|
|
|
|
|
|
function stopTimer() {
|
|
|
|
swObject.stopTimer();
|
|
|
|
}
|
|
|
|
|
|
|
|
function onButtonShort(btn) {
|
|
|
|
switch (btn) {
|
|
|
|
case 1:
|
|
|
|
swObject.stopStart();
|
|
|
|
break;
|
|
|
|
case 2:
|
|
|
|
swObject.lapOrReset();
|
|
|
|
break;
|
|
|
|
case 3:
|
|
|
|
default:
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-07-04 18:38:53 +00:00
|
|
|
function onButtonLong(btn) {
|
|
|
|
if (btn === 2) Bangle.showLauncher();
|
|
|
|
}
|
2021-04-14 21:54:01 +00:00
|
|
|
|
|
|
|
return {init:init, freeResources:freeResources, startTimer:startTimer, stopTimer:stopTimer,
|
|
|
|
onButtonShort:onButtonShort, onButtonLong:onButtonLong};
|
|
|
|
}
|
|
|
|
|
|
|
|
return getFace;
|
|
|
|
})();
|