1
0
Fork 0
mirror of https://github.com/betaflight/betaflight-configurator.git synced 2025-07-17 13:25:24 +03:00

Fixed lockup on failed 'flash on connect' operation. Also removed persisting of 'flash on connect' option since it can lead to accidental flasing.

This commit is contained in:
mikeller 2016-10-30 19:34:30 +13:00
parent 6a282565ed
commit b9b0ae542d
2 changed files with 52 additions and 53 deletions

View file

@ -748,25 +748,34 @@ STM32_protocol.prototype.upload_procedure = function (step) {
GUI.interval_remove('STM32_timeout'); // stop STM32 timeout timer (everything is finished now)
// close connection
serial.disconnect(function (result) {
PortUsage.reset();
if (serial.connectionId) {
serial.disconnect(self.cleanup);
} else {
self.cleanup();
}
// unlocking connect button
GUI.connect_lock = false;
// unlock some UI elements TODO needs rework
$('select[name="release"]').prop('disabled', false);
// handle timing
var timeSpent = new Date().getTime() - self.upload_time_start;
console.log('Script finished after: ' + (timeSpent / 1000) + ' seconds');
if (self.callback) self.callback();
});
break;
}
};
STM32_protocol.prototype.cleanup = function () {
PortUsage.reset();
// unlocking connect button
GUI.connect_lock = false;
// unlock some UI elements TODO needs rework
$('select[name="release"]').prop('disabled', false);
// handle timing
var timeSpent = new Date().getTime() - self.upload_time_start;
console.log('Script finished after: ' + (timeSpent / 1000) + ' seconds');
if (self.callback) {
self.callback();
}
}
// initialize object
var STM32 = new STM32_protocol();