1
0
Fork 0
mirror of https://github.com/iNavFlight/inav-configurator.git synced 2025-07-13 11:29:53 +03:00

more strict

This commit is contained in:
cTn 2014-08-09 20:47:07 +02:00
parent f16b3a479a
commit fc0fff017e
3 changed files with 12 additions and 8 deletions

View file

@ -5,6 +5,7 @@
popular choices - 921600, 460800, 256000, 230400, 153600, 128000, 115200, 57600, 38400, 28800, 19200
*/
'use strict';
var STM32_protocol = function() {
this.options = {};
@ -449,7 +450,7 @@ STM32_protocol.prototype.upload_procedure = function(step) {
var bytes_flashed = 0;
var bytes_flashed_total = 0; // used for progress bar
function write() {
var write = function () {
if (bytes_flashed < self.hex.data[flashing_block].bytes) {
var bytes_to_write = ((bytes_flashed + 256) <= self.hex.data[flashing_block].bytes) ? 256 : (self.hex.data[flashing_block].bytes - bytes_flashed);
@ -530,7 +531,7 @@ STM32_protocol.prototype.upload_procedure = function(step) {
self.verify_hex.push([]);
}
function reading() {
var reading = function () {
if (bytes_verified < self.hex.data[reading_block].bytes) {
var bytes_to_read = ((bytes_verified + 256) <= self.hex.data[reading_block].bytes) ? 256 : (self.hex.data[reading_block].bytes - bytes_verified);