1
0
Fork 0
mirror of https://github.com/betaflight/betaflight-configurator.git synced 2025-07-19 14:25:14 +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,7 +748,17 @@ 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) {
if (serial.connectionId) {
serial.disconnect(self.cleanup);
} else {
self.cleanup();
}
break;
}
};
STM32_protocol.prototype.cleanup = function () {
PortUsage.reset();
// unlocking connect button
@ -762,11 +772,10 @@ STM32_protocol.prototype.upload_procedure = function (step) {
console.log('Script finished after: ' + (timeSpent / 1000) + ' seconds');
if (self.callback) self.callback();
});
break;
if (self.callback) {
self.callback();
}
};
}
// initialize object
var STM32 = new STM32_protocol();

View file

@ -480,13 +480,6 @@ TABS.firmware_flasher.initialize = function (callback) {
$('input.flash_manual_baud_rate').change();
});
chrome.storage.local.get('flash_on_connect', function (result) {
if (result.flash_on_connect) {
$('input.flash_on_connect').prop('checked', true);
} else {
$('input.flash_on_connect').prop('checked', false);
}
$('input.flash_on_connect').change(function () {
var status = $(this).is(':checked');
@ -516,10 +509,7 @@ TABS.firmware_flasher.initialize = function (callback) {
} else {
PortHandler.flush_callbacks();
}
chrome.storage.local.set({'flash_on_connect': status});
}).change();
});
chrome.storage.local.get('erase_chip', function (result) {
if (result.erase_chip) {