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

Cleanup crunch(), switch to use .pushX functions

This commit is contained in:
Anton Stålheim 2016-08-18 00:49:02 +02:00
parent 6275b8b462
commit 44a0d54ea9
4 changed files with 172 additions and 272 deletions

View file

@ -10,6 +10,13 @@ Array.prototype.push16 = function(val) {
// chainable
return this;
};
Array.prototype.push32 = function(val) {
this.push8(val)
.push8(val >> 8)
.push8(val >> 16)
.push8(val >> 24);
return this;
}
DataView.prototype.offset = 0;
DataView.prototype.readU8 = function() {
if (this.byteLength >= this.offset+1) {