1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-18 13:55:18 +03:00
This commit is contained in:
cTn 2013-11-13 11:48:45 +01:00
parent eb694f866f
commit bac9677d15
2 changed files with 18 additions and 20 deletions

View file

@ -19,6 +19,7 @@ function read_hex_file(data) {
var content = data[i].substr(9, byte_count);
var checksum = parseInt(data[i].substr(9 + byte_count, 2), 16); // also converting from hex to decimal (this is a 2's complement value)
if (record_type == 0x00) { // data record
if (byte_count > 0) {
var crc = (byte_count / 2) + parseInt(address.substr(0, 2), 16) + parseInt(address.substr(2, 2), 16) + record_type;
for (var needle = 0; needle < byte_count; needle += 2) {
@ -39,6 +40,7 @@ function read_hex_file(data) {
}
}
}
}
if (hexfile_valid) {
console.log('HEX file parsed: ' + bytes_total + ' bytes');

View file

@ -113,10 +113,6 @@ STM32_protocol.prototype.initialize = function() {
}
}, 1000);
// there seems to be 2 unwanted bytes in the parsed array, we will drop them now (WHY ???)
this.hex_to_flash.shift();
this.hex_to_flash.shift();
// first step
if ($('input.updating').is(':checked')) {
self.upload_procedure(0);