0.26: Remove buzz in setUI polyfill (#750)

master
Gordon Williams 2021-06-08 09:38:08 +01:00
parent 6a092262fd
commit 2dd8844a45
3 changed files with 10 additions and 12 deletions

View File

@ -4,7 +4,7 @@
"tags": "tool,system", "tags": "tool,system",
"type":"bootloader", "type":"bootloader",
"icon": "bootloader.png", "icon": "bootloader.png",
"version":"0.25", "version":"0.26",
"description": "This is needed by Bangle.js to automatically load the clock, menu, widgets and settings", "description": "This is needed by Bangle.js to automatically load the clock, menu, widgets and settings",
"storage": [ "storage": [
{"name":".boot0","url":"boot0.js"}, {"name":".boot0","url":"boot0.js"},

View File

@ -24,3 +24,4 @@
0.23: Move to a precalculated .boot0 file which should speed up load time 0.23: Move to a precalculated .boot0 file which should speed up load time
0.24: Add Bangle.setUI polyfill 0.24: Add Bangle.setUI polyfill
0.25: Fix error in 'no clock app' message 0.25: Fix error in 'no clock app' message
0.26: Remove buzz in setUI polyfill (#750)

View File

@ -97,25 +97,22 @@ if (Bangle.touchandler) {
Bangle.removeListener("touch", Bangle.touchHandler); Bangle.removeListener("touch", Bangle.touchHandler);
delete Bangle.touchHandler; delete Bangle.touchHandler;
} }
function b() {
try{Bangle.buzz(20);}catch(e){}
}
if (!mode) return; if (!mode) return;
else if (mode=="updown") { else if (mode=="updown") {
Bangle.btnWatches = [ Bangle.btnWatches = [
setWatch(function() { b();cb(-1); }, BTN1, {repeat:1}), setWatch(function() { cb(-1); }, BTN1, {repeat:1}),
setWatch(function() { b();cb(1); }, BTN3, {repeat:1}), setWatch(function() { cb(1); }, BTN3, {repeat:1}),
setWatch(function() { b();cb(); }, BTN2, {repeat:1}) setWatch(function() { cb(); }, BTN2, {repeat:1})
]; ];
} else if (mode=="leftright") { } else if (mode=="leftright") {
Bangle.btnWatches = [ Bangle.btnWatches = [
setWatch(function() { b();cb(-1); }, BTN1, {repeat:1}), setWatch(function() { cb(-1); }, BTN1, {repeat:1}),
setWatch(function() { b();cb(1); }, BTN3, {repeat:1}), setWatch(function() { cb(1); }, BTN3, {repeat:1}),
setWatch(function() { b();cb(); }, BTN2, {repeat:1}) setWatch(function() { cb(); }, BTN2, {repeat:1})
]; ];
Bangle.swipeHandler = d => {b();cb(d);}; Bangle.swipeHandler = d => {cb(d);};
Bangle.on("swipe", Bangle.swipeHandler); Bangle.on("swipe", Bangle.swipeHandler);
Bangle.touchHandler = d => {b();cb();}; Bangle.touchHandler = d => {cb();};
Bangle.on("touch", Bangle.touchHandler); Bangle.on("touch", Bangle.touchHandler);
} else } else
throw new Error("Unknown UI mode"); throw new Error("Unknown UI mode");