support for multiwiicurrentoutput

10.3.x-maintenance
cTn 2014-09-18 12:24:38 +02:00
parent 6f9c5cb6f2
commit 800bfd59c8
3 changed files with 19 additions and 20 deletions

View File

@ -29,8 +29,7 @@ var BF_CONFIG = {
serialrx_type: 0,
board_align_roll: 0,
board_align_pitch: 0,
board_align_yaw: 0,
multiwiicurrentoutput: 0
board_align_yaw: 0
// TBD
};
@ -112,7 +111,7 @@ var MISC = {
gps_type: 0,
gps_baudrate: 0,
gps_ubx_sbas: 0,
placeholder1: 0,
multiwiicurrentoutput: 0,
placeholder2: 0,
mag_declination: 0, // not checked
vbatscale: 0,

View File

@ -638,7 +638,7 @@ MSP.crunch = function (code) {
buffer.push(MISC.gps_type);
buffer.push(MISC.gps_baudrate);
buffer.push(MISC.gps_ubx_sbas);
buffer.push(MISC.placeholder1);
buffer.push(MISC.multiwiicurrentoutput);
buffer.push(lowByte(MISC.placeholder2));
buffer.push(highByte(MISC.placeholder2));
buffer.push(lowByte(MISC.mag_declination));

View File

@ -227,7 +227,7 @@ TABS.configuration.initialize = function (callback) {
$('input[name="mincellvoltage"]').val(MISC.vbatmincellvoltage);
$('input[name="maxcellvoltage"]').val(MISC.vbatmaxcellvoltage);
$('input[name="voltagescale"]').val(MISC.vbatscale);
$('input[name="multiwiicurrentoutput"]').prop('checked', BF_CONFIG.multiwiicurrentoutput);
$('input[name="multiwiicurrentoutput"]').prop('checked', MISC.multiwiicurrentoutput);
// UI hooks
@ -262,7 +262,7 @@ TABS.configuration.initialize = function (callback) {
MISC.vbatmincellvoltage = parseFloat($('input[name="mincellvoltage"]').val()) * 10;
MISC.vbatmaxcellvoltage = parseFloat($('input[name="maxcellvoltage"]').val()) * 10;
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() {
MSP.send_message(MSP_codes.MSP_SET_MISC, MSP.crunch(MSP_codes.MSP_SET_MISC), false, save_acc_trim);