mirror of
https://github.com/iNavFlight/inav-configurator.git
synced 2025-07-14 20:10:11 +03:00
polishing last commit
This commit is contained in:
parent
0339c396a7
commit
fd50a72d0a
1 changed files with 10 additions and 0 deletions
10
js/stm32.js
10
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();
|
||||
}
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue