From 14d125a4ad9d78be5254899ade0e8c7f4c1bf80e Mon Sep 17 00:00:00 2001 From: cTn Date: Tue, 28 Jan 2014 01:11:37 +0100 Subject: [PATCH] shaving down some delay time --- js/stm32.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/js/stm32.js b/js/stm32.js index 4d7fd540..57e3dbb1 100644 --- a/js/stm32.js +++ b/js/stm32.js @@ -84,9 +84,12 @@ STM32_protocol.prototype.connect = function(hex) { // we are connected, disabling connect button in the UI 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) { if (result) { 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; } }); - }, 100); + }); } }); } else { @@ -358,7 +361,7 @@ STM32_protocol.prototype.upload_procedure = function(step) { // stop retrying, its too late to get any response from MCU GUI.interval_remove('stm32_initialize_mcu'); } - }, 200); + }, 200, true); break; case 2: // get version of the bootloader and supported commands