1
0
Fork 0
mirror of https://github.com/iNavFlight/inav-configurator.git synced 2025-07-17 05:15:20 +03:00

shaving down some delay time

This commit is contained in:
cTn 2014-01-28 01:11:37 +01:00
parent 853860b1ad
commit 14d125a4ad

View file

@ -84,9 +84,12 @@ STM32_protocol.prototype.connect = function(hex) {
// we are connected, disabling connect button in the UI // we are connected, disabling connect button in the UI
GUI.connect_lock = true; GUI.connect_lock = true;
self.send([0x52]); var bufferOut = new ArrayBuffer(1);
var bufferView = new Uint8Array(bufferOut);
GUI.timeout_add('reboot_into_bootloader', function() { bufferView[0] = 0x52;
serial.send(bufferOut, function() {
serial.disconnect(function(result) { serial.disconnect(function(result) {
if (result) { if (result) {
serial.connect(selected_port, {bitrate: flashing_bitrate, parityBit: 'even', stopBits: 'one'}, function(openInfo) { serial.connect(selected_port, {bitrate: flashing_bitrate, parityBit: 'even', stopBits: 'one'}, function(openInfo) {
@ -98,7 +101,7 @@ STM32_protocol.prototype.connect = function(hex) {
GUI.connect_lock = false; GUI.connect_lock = false;
} }
}); });
}, 100); });
} }
}); });
} else { } else {
@ -358,7 +361,7 @@ STM32_protocol.prototype.upload_procedure = function(step) {
// stop retrying, its too late to get any response from MCU // stop retrying, its too late to get any response from MCU
GUI.interval_remove('stm32_initialize_mcu'); GUI.interval_remove('stm32_initialize_mcu');
} }
}, 200); }, 200, true);
break; break;
case 2: case 2:
// get version of the bootloader and supported commands // get version of the bootloader and supported commands