Merge pull request #217 from KiteAnton/msp_fixes

MSP fixes
10.3.x-maintenance
Michael Keller 2016-08-14 21:39:03 +12:00 committed by GitHub
commit 14428d910f
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) {