MSP fixes

10.3.x-maintenance
KiteAnton 2016-08-13 18:01:47 +02:00
parent c917f69ac7
commit 4a0e855a43
3 changed files with 9 additions and 4 deletions

View File

@ -108,13 +108,13 @@ var MSP = {
});
},
listen: function(listener) {
if (this.listeners[0] == undefined) {
this.listeners[0] = listener;
}
else if (this.listeners.indexOf(listener) == -1) {
if (this.listeners.indexOf(listener) == -1) {
this.listeners.push(listener);
}
},
clearListeners: function() {
this.listeners = [];
},
send_message: function (code, data, callback_sent, callback_msp) {
var bufferOut,
bufView;

View File

@ -683,6 +683,9 @@ MspHelper.prototype.process_data = function(dataHandler) {
FILTER_CONFIG.yaw_lpf_hz = data.getUint16(offset, 1);
break;
case MSPCodes.MSP_SET_PID_ADVANCED:
console.log("Advanced PID settings saved");
break;
case MSPCodes.MSP_PID_ADVANCED:
var offset = 0;
if (semver.gte(CONFIG.flightControllerVersion, "3.0.0")) {

View File

@ -322,6 +322,8 @@ function onClosed(result) {
var battery = $('#quad-status_wrapper');
battery.hide();
MSP.clearListeners();
}
function read_serial(info) {