1
0
Fork 0
mirror of https://github.com/iNavFlight/inav-configurator.git synced 2025-07-14 11:59:51 +03:00

created MSP disconnect cleanup routine

This commit is contained in:
cTn 2014-01-26 18:24:46 +01:00
parent 575f5ac8ef
commit 21af65567c
2 changed files with 17 additions and 3 deletions

View file

@ -65,7 +65,22 @@ var MSP = {
message_checksum: 0, message_checksum: 0,
callbacks: [], callbacks: [],
packet_error: 0 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
for (var i = 0; i < this.callbacks.length; i++) {
clearInterval(this.callbacks[i].timer);
}
*/
// drop references
this.callbacks = [];
}
}; };
function MSP_char_read(readInfo) { function MSP_char_read(readInfo) {

View file

@ -143,8 +143,7 @@ $(document).ready(function() {
$('.software-version').html('0.0'); $('.software-version').html('0.0');
$('span.cycle-time').html('0'); $('span.cycle-time').html('0');
MSP.state = 0; // reset packet state for "clean" initial entry (this is only required if user hot-disconnects) MSP.disconnect_cleanup();
MSP.packet_error = 0; // reset CRC packet error counter for next session
configuration_received = false; // reset valid config received variable (used to block tabs while not connected properly) configuration_received = false; // reset valid config received variable (used to block tabs while not connected properly)
// unlock port select & baud // unlock port select & baud