mirror of
https://github.com/betaflight/betaflight-configurator.git
synced 2025-07-20 14:55:15 +03:00
Merge pull request #1865 from fiam/agh_fix_1864
Fix problems introduced in #1851
This commit is contained in:
commit
53f4ad6489
1 changed files with 2 additions and 4 deletions
|
@ -819,8 +819,8 @@ MspHelper.prototype.process_data = function(dataHandler) {
|
|||
break;
|
||||
|
||||
case MSPCodes.MSP_CF_SERIAL_CONFIG:
|
||||
SERIAL_CONFIG.ports = [];
|
||||
if (semver.lt(CONFIG.apiVersion, "1.6.0")) {
|
||||
SERIAL_CONFIG.ports = [];
|
||||
const serialPortCount = (data.byteLength - (4 * 4)) / 2;
|
||||
for (let i = 0; i < serialPortCount; i++) {
|
||||
const serialPort = {
|
||||
|
@ -834,7 +834,6 @@ MspHelper.prototype.process_data = function(dataHandler) {
|
|||
SERIAL_CONFIG.gpsBaudRate = data.readU32();
|
||||
SERIAL_CONFIG.gpsPassthroughBaudRate = data.readU32();
|
||||
} else {
|
||||
SERIAL_CONFIG.ports = [];
|
||||
const bytesPerPort = 1 + 2 + (1 * 4);
|
||||
|
||||
const serialPortCount = data.byteLength / bytesPerPort;
|
||||
|
@ -854,6 +853,7 @@ MspHelper.prototype.process_data = function(dataHandler) {
|
|||
break;
|
||||
|
||||
case MSPCodes.MSP2_COMMON_SERIAL_CONFIG:
|
||||
SERIAL_CONFIG.ports = [];
|
||||
const count = data.readU8();
|
||||
const portConfigSize = data.remaining() / count;
|
||||
for (let ii = 0; ii < count; ii++) {
|
||||
|
@ -1877,7 +1877,6 @@ MspHelper.prototype.crunch = function(code) {
|
|||
|
||||
const functionMask = self.serialPortFunctionsToMask(serialPort.functions);
|
||||
buffer.push16(functionMask)
|
||||
.push8(self.BAUD_RATES.indexOf(serialPort.msp_baudrate))
|
||||
.push8(self.BAUD_RATES.indexOf(serialPort.msp_baudrate))
|
||||
.push8(self.BAUD_RATES.indexOf(serialPort.gps_baudrate))
|
||||
.push8(self.BAUD_RATES.indexOf(serialPort.telemetry_baudrate))
|
||||
|
@ -1896,7 +1895,6 @@ MspHelper.prototype.crunch = function(code) {
|
|||
|
||||
const functionMask = self.serialPortFunctionsToMask(serialPort.functions);
|
||||
buffer.push32(functionMask)
|
||||
.push8(self.BAUD_RATES.indexOf(serialPort.msp_baudrate))
|
||||
.push8(self.BAUD_RATES.indexOf(serialPort.msp_baudrate))
|
||||
.push8(self.BAUD_RATES.indexOf(serialPort.gps_baudrate))
|
||||
.push8(self.BAUD_RATES.indexOf(serialPort.telemetry_baudrate))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue