mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-19 22:35:23 +03:00
get MISC implementation
This commit is contained in:
parent
1f2180be89
commit
f72a99f327
2 changed files with 29 additions and 2 deletions
16
js/msp.js
16
js/msp.js
|
@ -342,8 +342,19 @@ function process_data(command, message_buffer, message_length_expected) {
|
||||||
AUX_CONFIG_values.push(data.getUint16(i, 1));
|
AUX_CONFIG_values.push(data.getUint16(i, 1));
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case MSP_codes.MSP_MISC:
|
case MSP_codes.MSP_MISC: // 22 bytes
|
||||||
console.log(data);
|
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;
|
break;
|
||||||
case MSP_codes.MSP_MOTOR_PINS:
|
case MSP_codes.MSP_MOTOR_PINS:
|
||||||
console.log(data);
|
console.log(data);
|
||||||
|
@ -408,6 +419,7 @@ function process_data(command, message_buffer, message_length_expected) {
|
||||||
console.log('Mag calibration executed');
|
console.log('Mag calibration executed');
|
||||||
break;
|
break;
|
||||||
case MSP_codes.MSP_SET_MISC:
|
case MSP_codes.MSP_SET_MISC:
|
||||||
|
console.log('MISC Configuration saved');
|
||||||
break;
|
break;
|
||||||
case MSP_codes.MSP_RESET_CONF:
|
case MSP_codes.MSP_RESET_CONF:
|
||||||
console.log('Settings Reset');
|
console.log('Settings Reset');
|
||||||
|
|
|
@ -86,6 +86,21 @@ var BATTERY = {
|
||||||
pMeterSum: 0,
|
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() {
|
$(document).ready(function() {
|
||||||
console.log('Scanning for new ports...');
|
console.log('Scanning for new ports...');
|
||||||
update_ports();
|
update_ports();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue