bugfix / cleanup routine for delayed data
requests that could leak into CLI and cause corruption10.3.x-maintenance
parent
238f18b5c5
commit
88ed454169
13
js/msp.js
13
js/msp.js
|
@ -67,17 +67,20 @@ var MSP = {
|
||||||
callbacks: [],
|
callbacks: [],
|
||||||
packet_error: 0,
|
packet_error: 0,
|
||||||
|
|
||||||
disconnect_cleanup: function() {
|
callbacks_cleanup: function() {
|
||||||
this.state = 0; // reset packet state for "clean" initial entry (this is only required if user hot-disconnects)
|
|
||||||
this.packet_error = 0; // reset CRC packet error counter for next session
|
|
||||||
|
|
||||||
// kill all "raw" MSP timers
|
|
||||||
for (var i = 0; i < this.callbacks.length; i++) {
|
for (var i = 0; i < this.callbacks.length; i++) {
|
||||||
clearInterval(this.callbacks[i].timer);
|
clearInterval(this.callbacks[i].timer);
|
||||||
}
|
}
|
||||||
|
|
||||||
// drop references
|
// drop references
|
||||||
this.callbacks = [];
|
this.callbacks = [];
|
||||||
|
},
|
||||||
|
|
||||||
|
disconnect_cleanup: function() {
|
||||||
|
this.state = 0; // reset packet state for "clean" initial entry (this is only required if user hot-disconnects)
|
||||||
|
this.packet_error = 0; // reset CRC packet error counter for next session
|
||||||
|
|
||||||
|
this.callbacks_cleanup();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -27,6 +27,9 @@ function tab_initialize_cli() {
|
||||||
$('#content').load("./tabs/cli.html", function() {
|
$('#content').load("./tabs/cli.html", function() {
|
||||||
GUI.active_tab = 'cli';
|
GUI.active_tab = 'cli';
|
||||||
|
|
||||||
|
// remove any active interval for delayed command
|
||||||
|
MSP.callbacks_cleanup();
|
||||||
|
|
||||||
CLI_active = true;
|
CLI_active = true;
|
||||||
|
|
||||||
// Enter CLI mode
|
// Enter CLI mode
|
||||||
|
|
Loading…
Reference in New Issue