1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-19 14:25:20 +03:00

bugfixes + removing obsolete code

This commit is contained in:
cTn 2013-11-09 06:18:45 +01:00
parent 0f23b5f5d9
commit 74323d894f
2 changed files with 18 additions and 41 deletions

View file

@ -134,22 +134,19 @@ GUI_control.prototype.tab_switch_cleanup = function(callback) {
bufView[4] = 0x0D; // enter
chrome.serial.write(connectionId, bufferOut, function(writeInfo) {
if (callback) {
// we could handle this "nicely", but this will do for now
// (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 could probably implement this someday
GUI.timeout_add('waiting_for_bootup', function() {
CLI_active = false;
callback();
}, 3000);
}
// we could handle this "nicely", but this will do for now
// (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 could probably implement this someday
GUI.timeout_add('waiting_for_bootup', function() {
CLI_active = false;
if (callback) callback();
}, 3000);
});
break;
default:
if (callback) {
callback();
}
if (callback) callback();
}
};

View file

@ -141,34 +141,14 @@ $(document).ready(function() {
if (clicks) { // odd number of clicks
// Disable any active "data pulling" timer
disable_timers();
// Disable CLI (there is no "nicer way of doing so right now)
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);
clearTimeout(connection_delay);
clearInterval(serial_poll);
clearInterval(port_usage_poll);
});
CLI_active = false;
} else {
chrome.serial.close(connectionId, onClosed);
clearTimeout(connection_delay);
clearInterval(serial_poll);
clearInterval(port_usage_poll);
}
GUI.tab_switch_cleanup();
chrome.serial.close(connectionId, onClosed);
clearTimeout(connection_delay);
clearInterval(serial_poll);
clearInterval(port_usage_poll);
// Change port utilization to 0
$('span.port-usage').html('0%');