widhid: continue on HID Report errors
e.g.
```
Uncaught Error: ERR 0xf (FORBIDDEN) (:3020)
at line 1 col 2082 in widhid.wid.js
NRF.sendHIDReport([1,code],function(){return NRF.sendHIDReport([1,0]);});
^
in function "sendHid" called from line 1 col 2165 in widhid.wid.js
sendHid(0x10);
^
in function "toggle" called from line 1 col 567 in widhid.wid.js
...s(e.y-anchor.y)<2)){toggle();onEvent();return;}}if(waitForRelease)...
^
in function called from system
```
master
parent
c4b08bda3b
commit
42e925d35e
|
|
@ -123,7 +123,12 @@
|
||||||
redraw();
|
redraw();
|
||||||
});
|
});
|
||||||
var sendHid = function (code) {
|
var sendHid = function (code) {
|
||||||
NRF.sendHIDReport([1, code], function () { return NRF.sendHIDReport([1, 0]); });
|
try {
|
||||||
|
NRF.sendHIDReport([1, code], function () { return NRF.sendHIDReport([1, 0]); });
|
||||||
|
}
|
||||||
|
catch (e) {
|
||||||
|
console.log("sendHIDReport:", e);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
var next = function () { return sendHid(0x01); };
|
var next = function () { return sendHid(0x01); };
|
||||||
var prev = function () { return sendHid(0x02); };
|
var prev = function () { return sendHid(0x02); };
|
||||||
|
|
|
||||||
|
|
@ -145,10 +145,14 @@
|
||||||
//const DEBUG = true;
|
//const DEBUG = true;
|
||||||
const sendHid = (code: number) => {
|
const sendHid = (code: number) => {
|
||||||
//if(DEBUG) return;
|
//if(DEBUG) return;
|
||||||
NRF.sendHIDReport(
|
try{
|
||||||
[1, code],
|
NRF.sendHIDReport(
|
||||||
() => NRF.sendHIDReport([1, 0]),
|
[1, code],
|
||||||
);
|
() => NRF.sendHIDReport([1, 0]),
|
||||||
|
);
|
||||||
|
}catch(e){
|
||||||
|
console.log("sendHIDReport:", e);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const next = () => /*DEBUG ? console.log("next") : */ sendHid(0x01);
|
const next = () => /*DEBUG ? console.log("next") : */ sendHid(0x01);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue