1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-16 21:05:35 +03:00

enforce stronger interval cleanup

This commit is contained in:
cTn 2014-07-09 15:46:35 +02:00
parent 71c0cb65b3
commit 795502a585
2 changed files with 6 additions and 66 deletions

View file

@ -193,36 +193,32 @@ GUI_control.prototype.tab_switch_cleanup = function(callback) {
switch (this.active_tab) {
case 'initial_setup':
GUI.interval_remove('initial_setup_data_pull');
GUI.interval_remove('status_pull');
GUI.interval_kill_all();
if (callback) callback();
break;
case 'pid_tuning':
GUI.interval_remove('status_pull');
GUI.interval_kill_all();
if (callback) callback();
break;
case 'receiver':
GUI.interval_remove('receiver_pull');
GUI.interval_remove('status_pull');
GUI.interval_kill_all();
if (callback) callback();
break;
case 'auxiliary_configuration':
GUI.interval_remove('aux_data_pull');
GUI.interval_remove('status_pull');
GUI.interval_kill_all();
if (callback) callback();
break;
case 'servos':
GUI.interval_remove('status_pull');
GUI.interval_kill_all();
if (callback) callback();
break;
case 'gps':
GUI.interval_remove('gps_pull');
GUI.interval_remove('status_pull');
GUI.interval_kill_all();
if (callback) callback();
break;
@ -270,7 +266,6 @@ GUI_control.prototype.tab_switch_cleanup = function(callback) {
if (callback) callback();
break;
case 'firmware_flasher':
// this.interval_remove('factory_mode');
PortHandler.flush_callbacks();
// unbind "global" events

View file

@ -211,61 +211,6 @@ function tab_initialize_firmware_flasher() {
});
});
/*
chrome.storage.local.get('dev_mode', function(result) {
if (typeof result.dev_mode !== 'undefined') {
if (result.dev_mode) {
GUI.log('Dev mode: <strong>Enabled</strong>');
bind_enter_handler();
}
}
});
var keys_down = {};
$(document).keydown(function(e) {
keys_down[e.which] = true;
// idkfa
if (keys_down[65] && keys_down[68] && keys_down[70] && keys_down[73] && keys_down[75]) {
chrome.storage.local.get('dev_mode', function(result) {
if (typeof result.dev_mode === 'undefined') {
GUI.log('Dev mode: <strong>Enabled</strong>');
bind_enter_handler();
chrome.storage.local.set({'dev_mode': true});
}
});
}
});
$(document).keyup(function(e) {
delete keys_down[e.which];
});
function bind_enter_handler() {
// unbind first (in case there is anything bound here)
$(document).unbind('keypress');
$(document).keypress(function(e) {
if (e.which == 13) { // enter
// Trigger regular Flashing sequence
$('a.flash_firmware').click();
}
});
}
*/
/*
GUI.interval_add('factory_mode', function factory_mode() {
serial.getControlSignals(function(result) {
if (result.cts == true) {
// Trigger regular Flashing sequence
$('a.flash_firmware').click();
}
});
}, 500);
*/
$(document).keypress(function(e) {
if (e.which == 13) { // enter
// Trigger regular Flashing sequence