mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-16 21:05:35 +03:00
support for multiwiicurrentoutput
This commit is contained in:
parent
6f9c5cb6f2
commit
800bfd59c8
3 changed files with 19 additions and 20 deletions
|
@ -29,8 +29,7 @@ var BF_CONFIG = {
|
||||||
serialrx_type: 0,
|
serialrx_type: 0,
|
||||||
board_align_roll: 0,
|
board_align_roll: 0,
|
||||||
board_align_pitch: 0,
|
board_align_pitch: 0,
|
||||||
board_align_yaw: 0,
|
board_align_yaw: 0
|
||||||
multiwiicurrentoutput: 0
|
|
||||||
// TBD
|
// TBD
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -104,19 +103,19 @@ var ANALOG = {
|
||||||
};
|
};
|
||||||
|
|
||||||
var MISC = {
|
var MISC = {
|
||||||
midrc: 0,
|
midrc: 0,
|
||||||
minthrottle: 0,
|
minthrottle: 0,
|
||||||
maxthrottle: 0,
|
maxthrottle: 0,
|
||||||
mincommand: 0,
|
mincommand: 0,
|
||||||
failsafe_throttle: 0,
|
failsafe_throttle: 0,
|
||||||
gps_type: 0,
|
gps_type: 0,
|
||||||
gps_baudrate: 0,
|
gps_baudrate: 0,
|
||||||
gps_ubx_sbas: 0,
|
gps_ubx_sbas: 0,
|
||||||
placeholder1: 0,
|
multiwiicurrentoutput: 0,
|
||||||
placeholder2: 0,
|
placeholder2: 0,
|
||||||
mag_declination: 0, // not checked
|
mag_declination: 0, // not checked
|
||||||
vbatscale: 0,
|
vbatscale: 0,
|
||||||
vbatmincellvoltage: 0,
|
vbatmincellvoltage: 0,
|
||||||
vbatmaxcellvoltage: 0,
|
vbatmaxcellvoltage: 0,
|
||||||
placeholder3: 0
|
placeholder3: 0
|
||||||
};
|
};
|
|
@ -638,7 +638,7 @@ MSP.crunch = function (code) {
|
||||||
buffer.push(MISC.gps_type);
|
buffer.push(MISC.gps_type);
|
||||||
buffer.push(MISC.gps_baudrate);
|
buffer.push(MISC.gps_baudrate);
|
||||||
buffer.push(MISC.gps_ubx_sbas);
|
buffer.push(MISC.gps_ubx_sbas);
|
||||||
buffer.push(MISC.placeholder1);
|
buffer.push(MISC.multiwiicurrentoutput);
|
||||||
buffer.push(lowByte(MISC.placeholder2));
|
buffer.push(lowByte(MISC.placeholder2));
|
||||||
buffer.push(highByte(MISC.placeholder2));
|
buffer.push(highByte(MISC.placeholder2));
|
||||||
buffer.push(lowByte(MISC.mag_declination));
|
buffer.push(lowByte(MISC.mag_declination));
|
||||||
|
|
|
@ -227,7 +227,7 @@ TABS.configuration.initialize = function (callback) {
|
||||||
$('input[name="mincellvoltage"]').val(MISC.vbatmincellvoltage);
|
$('input[name="mincellvoltage"]').val(MISC.vbatmincellvoltage);
|
||||||
$('input[name="maxcellvoltage"]').val(MISC.vbatmaxcellvoltage);
|
$('input[name="maxcellvoltage"]').val(MISC.vbatmaxcellvoltage);
|
||||||
$('input[name="voltagescale"]').val(MISC.vbatscale);
|
$('input[name="voltagescale"]').val(MISC.vbatscale);
|
||||||
$('input[name="multiwiicurrentoutput"]').prop('checked', BF_CONFIG.multiwiicurrentoutput);
|
$('input[name="multiwiicurrentoutput"]').prop('checked', MISC.multiwiicurrentoutput);
|
||||||
|
|
||||||
|
|
||||||
// UI hooks
|
// UI hooks
|
||||||
|
@ -262,7 +262,7 @@ TABS.configuration.initialize = function (callback) {
|
||||||
MISC.vbatmincellvoltage = parseFloat($('input[name="mincellvoltage"]').val()) * 10;
|
MISC.vbatmincellvoltage = parseFloat($('input[name="mincellvoltage"]').val()) * 10;
|
||||||
MISC.vbatmaxcellvoltage = parseFloat($('input[name="maxcellvoltage"]').val()) * 10;
|
MISC.vbatmaxcellvoltage = parseFloat($('input[name="maxcellvoltage"]').val()) * 10;
|
||||||
MISC.vbatscale = parseInt($('input[name="voltagescale"]').val());
|
MISC.vbatscale = parseInt($('input[name="voltagescale"]').val());
|
||||||
BF_CONFIG.multiwiicurrentoutput = ~~$('input[name="multiwiicurrentoutput"]').is(':checked'); // ~~ boolean to decimal conversion
|
MISC.multiwiicurrentoutput = ~~$('input[name="multiwiicurrentoutput"]').is(':checked'); // ~~ boolean to decimal conversion
|
||||||
|
|
||||||
function save_misc() {
|
function save_misc() {
|
||||||
MSP.send_message(MSP_codes.MSP_SET_MISC, MSP.crunch(MSP_codes.MSP_SET_MISC), false, save_acc_trim);
|
MSP.send_message(MSP_codes.MSP_SET_MISC, MSP.crunch(MSP_codes.MSP_SET_MISC), false, save_acc_trim);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue