From 2e046db53e1774c4fbbd2c6662e9c74d7598d24e Mon Sep 17 00:00:00 2001 From: Dominic Clifton Date: Sun, 29 Mar 2015 12:06:33 +0100 Subject: [PATCH] Ensure offset variable is updated consistently in MSP_MISC. See 9261163ca295c7884179ed43e2c7866b3b06a140 --- js/msp.js | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/js/msp.js b/js/msp.js index 40cf3c81..c3d787f7 100644 --- a/js/msp.js +++ b/js/msp.js @@ -375,18 +375,18 @@ var MSP = { offset += 2; MISC.failsafe_throttle = data.getUint16(offset, 1); // 1000-2000 offset += 2; - MISC.gps_type = data.getUint8(offset); - MISC.gps_baudrate = data.getUint8(++offset); - MISC.gps_ubx_sbas = data.getInt8(++offset); - 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.gps_type = data.getUint8(offset++); + MISC.gps_baudrate = data.getUint8(offset++); + MISC.gps_ubx_sbas = data.getInt8(offset++); + 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 offset += 2; - MISC.vbatscale = data.getUint8(offset, 1); // 10-200 - MISC.vbatmincellvoltage = data.getUint8(++offset, 1) / 10; // 10-50 - MISC.vbatmaxcellvoltage = data.getUint8(++offset, 1) / 10; // 10-50 - MISC.vbatwarningcellvoltage = data.getUint8(++offset, 1) / 10; // 10-50 + MISC.vbatscale = data.getUint8(offset++, 1); // 10-200 + MISC.vbatmincellvoltage = data.getUint8(offset++, 1) / 10; // 10-50 + MISC.vbatmaxcellvoltage = data.getUint8(offset++, 1) / 10; // 10-50 + MISC.vbatwarningcellvoltage = data.getUint8(offset++, 1) / 10; // 10-50 break; case MSP_codes.MSP_MOTOR_PINS: console.log(data);