From fd50a72d0a81955d6a7fa616f8e891ac02f5798c Mon Sep 17 00:00:00 2001 From: cTn Date: Thu, 14 Nov 2013 16:48:37 +0100 Subject: [PATCH] polishing last commit --- js/stm32.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/js/stm32.js b/js/stm32.js index b1f69e67..e7943331 100644 --- a/js/stm32.js +++ b/js/stm32.js @@ -61,6 +61,7 @@ STM32_protocol.prototype.connect = function() { if (connectionId != -1) { console.log('Connection was opened with ID: ' + connectionId); + console.log('Sending ascii "R" to reboot'); // we are connected, disabling connect button in the UI GUI.connect_lock = true; @@ -70,10 +71,14 @@ STM32_protocol.prototype.connect = function() { GUI.timeout_add('reboot_into_bootloader', function() { chrome.serial.close(connectionId, function(result) { if (result) { + console.log('Connection closed successfully.'); + chrome.serial.open(selected_port, {bitrate: 115200, parityBit: 'evenparity', stopBit: 'onestopbit'}, function(openInfo) { connectionId = openInfo.connectionId; if (connectionId != -1) { + console.log('Connection was opened with ID: ' + connectionId); + self.initialize(); } }); @@ -87,6 +92,11 @@ STM32_protocol.prototype.connect = function() { connectionId = openInfo.connectionId; if (connectionId != -1) { + console.log('Connection was opened with ID: ' + connectionId); + + // we are connected, disabling connect button in the UI + GUI.connect_lock = true; + self.initialize(); } });