mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-20 14:55:21 +03:00
bugfixes + removing obsolete code
This commit is contained in:
parent
0f23b5f5d9
commit
74323d894f
2 changed files with 18 additions and 41 deletions
|
@ -134,22 +134,19 @@ GUI_control.prototype.tab_switch_cleanup = function(callback) {
|
||||||
bufView[4] = 0x0D; // enter
|
bufView[4] = 0x0D; // enter
|
||||||
|
|
||||||
chrome.serial.write(connectionId, bufferOut, function(writeInfo) {
|
chrome.serial.write(connectionId, bufferOut, function(writeInfo) {
|
||||||
if (callback) {
|
|
||||||
// we could handle this "nicely", but this will do for now
|
// we could handle this "nicely", but this will do for now
|
||||||
// (another approach is however much more complicated):
|
// (another approach is however much more complicated):
|
||||||
// we can setup an interval asking for data lets say every 200ms, when data arrives, callback will be triggered and tab switched
|
// we can setup an interval asking for data lets say every 200ms, when data arrives, callback will be triggered and tab switched
|
||||||
// we could probably implement this someday
|
// we could probably implement this someday
|
||||||
GUI.timeout_add('waiting_for_bootup', function() {
|
GUI.timeout_add('waiting_for_bootup', function() {
|
||||||
CLI_active = false;
|
CLI_active = false;
|
||||||
callback();
|
|
||||||
|
if (callback) callback();
|
||||||
}, 3000);
|
}, 3000);
|
||||||
}
|
|
||||||
});
|
});
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
if (callback) {
|
if (callback) callback();
|
||||||
callback();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -142,33 +142,13 @@ $(document).ready(function() {
|
||||||
// Disable any active "data pulling" timer
|
// Disable any active "data pulling" timer
|
||||||
disable_timers();
|
disable_timers();
|
||||||
|
|
||||||
// Disable CLI (there is no "nicer way of doing so right now)
|
GUI.tab_switch_cleanup();
|
||||||
if (CLI_active == true) {
|
|
||||||
var bufferOut = new ArrayBuffer(5);
|
|
||||||
var bufView = new Uint8Array(bufferOut);
|
|
||||||
|
|
||||||
bufView[0] = 0x65; // e
|
|
||||||
bufView[1] = 0x78; // x
|
|
||||||
bufView[2] = 0x69; // i
|
|
||||||
bufView[3] = 0x74; // t
|
|
||||||
bufView[4] = 0x0D; // enter
|
|
||||||
|
|
||||||
chrome.serial.write(connectionId, bufferOut, function(writeInfo) {
|
|
||||||
chrome.serial.close(connectionId, onClosed);
|
chrome.serial.close(connectionId, onClosed);
|
||||||
|
|
||||||
clearTimeout(connection_delay);
|
clearTimeout(connection_delay);
|
||||||
clearInterval(serial_poll);
|
clearInterval(serial_poll);
|
||||||
clearInterval(port_usage_poll);
|
clearInterval(port_usage_poll);
|
||||||
});
|
|
||||||
|
|
||||||
CLI_active = false;
|
|
||||||
} else {
|
|
||||||
chrome.serial.close(connectionId, onClosed);
|
|
||||||
|
|
||||||
clearTimeout(connection_delay);
|
|
||||||
clearInterval(serial_poll);
|
|
||||||
clearInterval(port_usage_poll);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Change port utilization to 0
|
// Change port utilization to 0
|
||||||
$('span.port-usage').html('0%');
|
$('span.port-usage').html('0%');
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue