diff --git a/js/msp.js b/js/msp.js index ea9d9920b1..124bc84208 100644 --- a/js/msp.js +++ b/js/msp.js @@ -214,6 +214,8 @@ function process_data(command, message_buffer, message_length_expected) { // IDENT received, show the tab content if (!configuration_received) { configuration_received = true; + + $('div#port-picker a.connect').text('Disconnect').addClass('active'); $('#tabs li a:first').click(); } break; diff --git a/js/serial_backend.js b/js/serial_backend.js index 7138f06c3b..d5a81c3850 100644 --- a/js/serial_backend.js +++ b/js/serial_backend.js @@ -109,12 +109,11 @@ $(document).ready(function() { console.log('Connecting to: ' + selected_port); GUI.connecting_to = selected_port; - chrome.serial.open(selected_port, { - bitrate: selected_baud - }, onOpen); + // lock port select & baud while we are connecting / connected + $('div#port-picker #port, div#port-picker #baud, div#port-picker #delay').prop('disabled', true); + $('div#port-picker a.connect').text('Connecting'); - $(this).text('Disconnect'); - $(this).addClass('active'); + chrome.serial.open(selected_port, {bitrate: selected_baud}, onOpen); } else { // Disable any active "data pulling" timer disable_timers(); @@ -135,6 +134,9 @@ $(document).ready(function() { // reset valid config received variable (used to block tabs while not connected properly) configuration_received = false; + // unlock port select & baud + $('div#port-picker #port, div#port-picker #baud, div#port-picker #delay').prop('disabled', false); + $(this).text('Connect'); $(this).removeClass('active'); }