1
0
Fork 0
mirror of https://github.com/iNavFlight/inav-configurator.git synced 2025-07-24 16:55:22 +03:00

Merge pull request #450 from iNavFlight/agh_workaround_f3_font_bug

Add a workaround for uploading fonts on F3 from macOS
This commit is contained in:
Alberto García Hierro 2018-05-25 13:15:54 +01:00 committed by GitHub
commit aeff96317a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 6 deletions

View file

@ -273,7 +273,7 @@ var MSP = {
}
},
send_message: function (code, data, callback_sent, callback_msp) {
send_message: function (code, data, callback_sent, callback_msp, protocolVersion) {
var payloadLength = data && data.length ? data.length : 0;
var length;
var buffer;
@ -281,7 +281,11 @@ var MSP = {
var checksum;
var ii;
switch (this.protocolVersion) {
if (!protocolVersion) {
protocolVersion = this.protocolVersion;
}
switch (protocolVersion) {
case this.constants.PROTOCOL_V1:
// TODO: Error if code is < 255 and MSPv1 is requested
length = payloadLength + 6;
@ -322,7 +326,7 @@ var MSP = {
view[length-1] = checksum;
break;
default:
throw "Invalid MSP protocol version " + this.protocolVersion;
throw "Invalid MSP protocol version " + protocolVersion;
}
@ -354,12 +358,12 @@ var MSP = {
}
return crc;
},
promise: function(code, data) {
promise: function(code, data, protocolVersion) {
var self = this;
return new Promise(function(resolve) {
self.send_message(code, data, false, function(data) {
resolve(data);
});
}, protocolVersion);
});
},
callbacks_cleanup: function () {