1
0
Fork 0
mirror of https://github.com/betaflight/betaflight-configurator.git synced 2025-07-16 12:55:14 +03:00

add bluebirdjs promises, inject some helpful methods in array

This commit is contained in:
nathan 2016-06-24 02:02:46 -07:00
parent 46c36048bb
commit 3f8fd78027
3 changed files with 45 additions and 0 deletions

12
js/injected_methods.js Normal file
View file

@ -0,0 +1,12 @@
Array.prototype.push8 = function(val) {
this.push(0xFF & val);
return this;
};
Array.prototype.push16 = function(val) {
// low byte
this.push(0x00FF & val);
// high byte
this.push(val >> 8);
// chainable
return this;
};