bikespeedo: tap / btn (when not recording) to toggle showMax

master
Rob Pilling 2023-05-25 21:38:29 +01:00
parent 86c6040a72
commit 96d4ae07d3
1 changed files with 14 additions and 7 deletions

View File

@ -492,6 +492,10 @@ function Compass_reading() {
hdngCompass = Compass_heading.toFixed(0); hdngCompass = Compass_heading.toFixed(0);
} }
function nextMode() {
showMax = 1 - showMax;
}
function start() { function start() {
Bangle.setBarometerPower(1); // needs some time... Bangle.setBarometerPower(1); // needs some time...
g.clearRect(0,screenYstart,screenW,screenH); g.clearRect(0,screenYstart,screenW,screenH);
@ -508,15 +512,18 @@ function start() {
Bangle.setUI({ Bangle.setUI({
mode: "custom", mode: "custom",
touch: nextMode,
btn: () => { btn: () => {
const rec = WIDGETS["recorder"]; const rec = WIDGETS["recorder"];
if(!rec) return; if(rec){
const active = rec.isRecording(); const active = rec.isRecording();
if(active) if(active)
rec.setRecording(false); rec.setRecording(false);
else else
rec.setRecording(true, { force: "append" }); rec.setRecording(true, { force: "append" });
}else{
nextMode();
}
}, },
}); });