mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-17 05:15:25 +03:00
bugfix / cleanup routine for delayed data
requests that could leak into CLI and cause corruption
This commit is contained in:
parent
238f18b5c5
commit
88ed454169
2 changed files with 11 additions and 5 deletions
13
js/msp.js
13
js/msp.js
|
@ -67,17 +67,20 @@ var MSP = {
|
|||
callbacks: [],
|
||||
packet_error: 0,
|
||||
|
||||
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
|
||||
|
||||
// kill all "raw" MSP timers
|
||||
callbacks_cleanup: function() {
|
||||
for (var i = 0; i < this.callbacks.length; i++) {
|
||||
clearInterval(this.callbacks[i].timer);
|
||||
}
|
||||
|
||||
// drop references
|
||||
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();
|
||||
}
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue