Skip to content

Commit

Permalink
Merge pull request #2040 from iNavFlight/dzikuvx-groundstation-activa…
Browse files Browse the repository at this point in the history
…tion

Activate groundstation when MSP switches to LTM
  • Loading branch information
DzikuVx authored Apr 25, 2024
2 parents 8103003 + aa8aee3 commit a4fd2bc
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 5 deletions.
2 changes: 1 addition & 1 deletion js/gui.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ GUI_control.prototype.log = function (message) {
GUI_control.prototype.tab_switch_cleanup = function (callback) {
MSP.callbacks_cleanup(); // we don't care about any old data that might or might not arrive

interval.killAll(['global_data_refresh', 'msp-load-update']);
interval.killAll(['global_data_refresh', 'msp-load-update', 'ltm-connection-check']);
mspBalancedInterval.flush();

if (this.active_tab) {
Expand Down
6 changes: 6 additions & 0 deletions js/intervals.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,8 @@ var interval = function () {
publicScope.killAll = function (keep_array) {
var timers_killed = 0;

console.log('Killing all intervals except: ' + keep_array);

for (var i = (privateScope.intervals.length - 1); i >= 0; i--) { // reverse iteration
var keep = false;
if (keep_array) { // only run through the array if it exists
Expand All @@ -131,6 +133,10 @@ var interval = function () {
return timers_killed;
};

publicScope.list = function () {
return privateScope.intervals;
};

return publicScope;
}();

Expand Down
2 changes: 1 addition & 1 deletion tabs/firmware_flasher.js
Original file line number Diff line number Diff line change
Expand Up @@ -774,7 +774,7 @@ TABS.firmware_flasher.onValidFirmware = function() {

TABS.firmware_flasher.closeTempConnection = function() {
timeout.killAll();
interval.killAll(['global_data_refresh', 'msp-load-update']);
interval.killAll(['global_data_refresh', 'msp-load-update', 'ltm-connection-check']);
mspBalancedInterval.flush();

mspQueue.flush();
Expand Down
2 changes: 1 addition & 1 deletion tabs/logging.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ TABS.logging.initialize = function (callback) {
GUI.log(i18n.getMessage('loggingErrorOneProperty'));
}
} else {
interval.killAll(['global_data_refresh', 'msp-load-update']);
interval.killAll(['global_data_refresh', 'msp-load-update', 'ltm-connection-check']);
mspBalancedInterval.flush();

$('.speed').prop('disabled', false);
Expand Down
2 changes: 1 addition & 1 deletion tabs/outputs.js
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,7 @@ TABS.outputs.initialize = function (callback) {
$voltageHelper = $(".current-voltage");

// timer initialization
interval.killAll(['motor_and_status_pull', 'global_data_refresh', 'msp-load-update']);
interval.killAll(['motor_and_status_pull', 'global_data_refresh', 'msp-load-update', 'ltm-connection-check']);
mspBalancedInterval.flush();

interval.add('IMU_pull', function () {
Expand Down
2 changes: 1 addition & 1 deletion tabs/sensors.js
Original file line number Diff line number Diff line change
Expand Up @@ -437,7 +437,7 @@ TABS.sensors.initialize = function (callback) {
});

// timer initialization
interval.killAll(['status_pull', 'global_data_refresh', 'msp-load-update']);
interval.killAll(['status_pull', 'global_data_refresh', 'msp-load-update', 'ltm-connection-check']);

// data pulling timers
if (checkboxes[0] || checkboxes[1] || checkboxes[2]) {
Expand Down

0 comments on commit a4fd2bc

Please sign in to comment.