mirror of https://github.com/espruino/BangleApps
change the logic to buzz at boot instead of before reboot
parent
d410c5acad
commit
e34728849f
|
@ -1,6 +1,6 @@
|
|||
# Long Press, Buzz!
|
||||
|
||||
Buzz on long press (assumed and hardcoded to 1500ms) to indicate the watch will be reinitiated per your command.
|
||||
Buzz at boot after a long press to indicate the watch was reinitiated per your command.
|
||||
|
||||
## Usage
|
||||
|
||||
|
|
|
@ -1,6 +1 @@
|
|||
let btnLoadTimeout = 1500; //Bangle.getOptions().btnLoadTimeout; // Hardcode value to minimize impact on load time at boot. Change to the commented out code to couple it to the actual system setting in the options object.
|
||||
let buzzTimeout;
|
||||
setWatch(function(e) { buzzTimeout = setTimeout(Bangle.buzz, btnLoadTimeout-100, 45, 0.35); }, BTN, {
|
||||
repeat:true, edge:'rising' });
|
||||
setWatch(function(e) { if (buzzTimeout) clearTimeout(buzzTimeout); }, BTN, {
|
||||
repeat:true, edge:'falling' });
|
||||
if (BTN.read()) Bangle.buzz(80,0.40);
|
||||
|
|
|
@ -2,13 +2,13 @@
|
|||
"name": "Long Press, Buzz!",
|
||||
"shortName":"LPB",
|
||||
"version":"0.01",
|
||||
"description": "Buzz on long press (assumed and hardcoded to 1500ms) to indicate the watch will be reinitiated per your command.",
|
||||
"description": "Buzz at boot after a long press to indicate the watch was reinitiated per your command.",
|
||||
"icon": "app.png",
|
||||
"type": "bootloader",
|
||||
"tags": "system",
|
||||
"supports" : ["BANGLEJS2"],
|
||||
"readme": "README.md",
|
||||
"storage": [
|
||||
{"name":"longpressbuzz.boot.js","url":"boot.js"}
|
||||
{"name":"longpressbuzz.0.boot.js","url":"boot.js"}
|
||||
]
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue