1
0
Fork 0
mirror of https://github.com/betaflight/betaflight-configurator.git synced 2025-07-19 06:15:13 +03:00

Revert "Blackbox download crc error packet retry - version 2"

This commit is contained in:
Michael Keller 2017-02-07 07:59:30 +13:00 committed by GitHub
parent 88d91a78a3
commit 70a172f9e0
2 changed files with 8 additions and 13 deletions

View file

@ -11,7 +11,6 @@ var MSP = {
message_buffer_uint8_view: null,
message_checksum: 0,
messageIsJumboFrame: false,
crcError: false,
callbacks: [],
packet_error: 0,
@ -110,19 +109,19 @@ var MSP = {
}
break;
case 9:
if (this.message_checksum != data[i]) {
console.log('code: ' + this.code + ' - crc failed');
this.packet_error++;
this.crcError = true;
}
if (this.message_checksum == data[i]) {
// message received, store dataview
this.dataView = new DataView(this.message_buffer, 0, this.message_length_expected);
} else {
console.log('code: ' + this.code + ' - crc failed');
this.dataView = null;
this.packet_error++;
}
// Reset variables
this.message_length_received = 0;
this.state = 0;
this.messageIsJumboFrame = false;
this.notify();
this.crcError = false;
break;
default:

View file

@ -52,7 +52,6 @@ MspHelper.prototype.process_data = function(dataHandler) {
var data = dataHandler.dataView; // DataView (allowing us to view arrayBuffer as struct/union)
var code = dataHandler.code;
var crcError = dataHandler.crcError;
if (!dataHandler.unsupported) switch (code) {
case MSPCodes.MSP_STATUS:
CONFIG.cycleTime = data.readU16();
@ -958,7 +957,7 @@ MspHelper.prototype.process_data = function(dataHandler) {
dataHandler.callbacks.splice(i, 1);
// fire callback
if (callback) callback({'command': code, 'data': data, 'length': data.byteLength, 'crcError': crcError});
if (callback) callback({'command': code, 'data': data, 'length': data.byteLength});
}
}
}
@ -1280,17 +1279,14 @@ MspHelper.prototype.dataflashRead = function(address, blockSize, onDataCallback)
dataCompressionType = response.data.readU8();
}
// Verify that the address of the memory returned matches what the caller asked for and there was not a CRC error
if ((chunkAddress == address) && !(response.crcError)) {
// Verify that the address of the memory returned matches what the caller asked for
if (chunkAddress == address) {
/* Strip that address off the front of the reply and deliver it separately so the caller doesn't have to
* figure out the reply format:
*/
onDataCallback(address, new DataView(response.data.buffer, response.data.byteOffset + headerSize, dataSize));
} else {
// Report error
if (response.crcError) {
console.log('CRC error for address ' + address + ' - retrying');
}
onDataCallback(address, null);
}
});