1
0
Fork 0
mirror of https://github.com/betaflight/betaflight-configurator.git synced 2025-07-24 16:55:24 +03:00

Issue #153 finer mag_declination in GUI

Allow declination to be set exactly in degrees,minutes (therefore uses
exactly the same value as in CLI instead of rounding it)
This commit is contained in:
gael 2016-04-18 23:19:07 +02:00
parent 81a49d48b2
commit a6807d5945
3 changed files with 5 additions and 5 deletions

View file

@ -430,7 +430,7 @@ var MSP = {
MISC.multiwiicurrentoutput = data.getUint8(offset++);
MISC.rssi_channel = data.getUint8(offset++);
MISC.placeholder2 = data.getUint8(offset++);
MISC.mag_declination = data.getInt16(offset, 1) / 10; // -18000-18000
MISC.mag_declination = data.getInt16(offset, 1) / 100; // -18000-18000
offset += 2;
MISC.vbatscale = data.getUint8(offset++, 1); // 10-200
MISC.vbatmincellvoltage = data.getUint8(offset++, 1) / 10; // 10-50
@ -1232,8 +1232,8 @@ MSP.crunch = function (code) {
buffer.push(MISC.multiwiicurrentoutput);
buffer.push(MISC.rssi_channel);
buffer.push(MISC.placeholder2);
buffer.push(lowByte(Math.round(MISC.mag_declination * 10)));
buffer.push(highByte(Math.round(MISC.mag_declination * 10)));
buffer.push(lowByte(Math.round(MISC.mag_declination * 100)));
buffer.push(highByte(Math.round(MISC.mag_declination * 100)));
buffer.push(MISC.vbatscale);
buffer.push(Math.round(MISC.vbatmincellvoltage * 10));
buffer.push(Math.round(MISC.vbatmaxcellvoltage * 10));