get MISC implementation

10.3.x-maintenance
cTn 2014-01-13 16:16:16 +01:00
parent 1f2180be89
commit f72a99f327
2 changed files with 29 additions and 2 deletions

View File

@ -342,8 +342,19 @@ function process_data(command, message_buffer, message_length_expected) {
AUX_CONFIG_values.push(data.getUint16(i, 1));
}
break;
case MSP_codes.MSP_MISC:
console.log(data);
case MSP_codes.MSP_MISC: // 22 bytes
MISC.PowerTrigger1 = data.getInt16(0, 1);
MISC.minthrottle = data.getUint16(2, 1); // 0-2000
MISC.maxthrottle = data.getUint16(4, 1); // 0-2000
MISC.mincommand = data.getUint16(6, 1); // 0-2000
MISC.failsafe_throttle = data.getUint16(8, 1); // 1000-2000
MISC.plog0 = data.getUint16(10, 1);
MISC.plog1 = data.getUint32(12, 1);
MISC.mag_declination = data.getInt16(16, 1);
MISC.vbatscale = data.getUint8(18, 1); // 10-200
MISC.vbatmincellvoltage = data.getUint8(19, 1) / 10; // 10-50
MISC.vbatmaxcellvoltage = data.getUint8(20, 1) / 10; // 10-50
MISC.empty = data.getUint8(21, 1);
break;
case MSP_codes.MSP_MOTOR_PINS:
console.log(data);
@ -408,6 +419,7 @@ function process_data(command, message_buffer, message_length_expected) {
console.log('Mag calibration executed');
break;
case MSP_codes.MSP_SET_MISC:
console.log('MISC Configuration saved');
break;
case MSP_codes.MSP_RESET_CONF:
console.log('Settings Reset');

View File

@ -86,6 +86,21 @@ var BATTERY = {
pMeterSum: 0,
};
var MISC = {
PowerTrigger1: 0, // intPowerTrigger1 (aka useless trash)
minthrottle: 0,
maxthrottle: 0,
mincommand: 0,
failsafe_throttle: 0,
plog0: 0, // plog useless shit
plog1: 0, // plog useless shit
mag_declination: 0, // not checked
vbatscale: 0,
vbatmincellvoltage: 0,
vbatmaxcellvoltage: 0,
empty: 0 // unknown
};
$(document).ready(function() {
console.log('Scanning for new ports...');
update_ports();