From 33688720e32797c2f2671725de99b7420703dcf1 Mon Sep 17 00:00:00 2001 From: Mark Haslinghuis Date: Fri, 19 Apr 2024 21:46:30 +0200 Subject: [PATCH] Use firmware options --- src/js/msp/MSPHelper.js | 2 +- src/js/serial_backend.js | 6 +++--- src/js/tabs/firmware_flasher.js | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/js/msp/MSPHelper.js b/src/js/msp/MSPHelper.js index d0594faf0bf..d5ce228f813 100644 --- a/src/js/msp/MSPHelper.js +++ b/src/js/msp/MSPHelper.js @@ -795,7 +795,7 @@ MspHelper.prototype.process_data = function(dataHandler) { FC.CONFIG.gitRevision = String.fromCharCode.apply(null, buff); console.log("Fw git rev:", FC.CONFIG.gitRevision); - if (semver.gte(FC.CONFIG.apiVersion, API_VERSION_1_47)) { + if (semver.gte(FC.CONFIG.apiVersion, API_VERSION_1_46)) { let option = data.readU16(); while (option) { FC.CONFIG.buildOptions.push(option); diff --git a/src/js/serial_backend.js b/src/js/serial_backend.js index b8d17283daf..28b92c20093 100644 --- a/src/js/serial_backend.js +++ b/src/js/serial_backend.js @@ -10,7 +10,7 @@ import MSP from "./msp"; import MSPCodes from "./msp/MSPCodes"; import PortUsage from "./port_usage"; import PortHandler from "./port_handler"; -import CONFIGURATOR, { API_VERSION_1_45, API_VERSION_1_46, API_VERSION_1_47 } from "./data_storage"; +import CONFIGURATOR, { API_VERSION_1_45, API_VERSION_1_46 } from "./data_storage"; import UI_PHONES from "./phones_ui"; import { bit_check } from './bit.js'; import { sensor_status, have_sensor } from "./sensor_helpers"; @@ -353,7 +353,7 @@ function onOpen(openInfo) { gui_log(i18n.getMessage('buildInfoReceived', [FC.CONFIG.buildInfo])); // retrieve build options from the flight controller - if (semver.gte(FC.CONFIG.apiVersion, API_VERSION_1_47)) { + if (semver.gte(FC.CONFIG.apiVersion, API_VERSION_1_46)) { FC.processBuildOptions(); } @@ -540,7 +540,7 @@ function checkReportProblems() { } async function processBuildOptions() { - const supported = semver.satisfies(FC.CONFIG.apiVersion, `${API_VERSION_1_45} - ${API_VERSION_1_46}`); + const supported = semver.eq(FC.CONFIG.apiVersion, API_VERSION_1_45); // firmware 1_45 or higher is required to support cloud build options // firmware 1_46 or higher retrieves build options from the flight controller diff --git a/src/js/tabs/firmware_flasher.js b/src/js/tabs/firmware_flasher.js index 371ebec04d5..c3c87c7ee24 100644 --- a/src/js/tabs/firmware_flasher.js +++ b/src/js/tabs/firmware_flasher.js @@ -12,7 +12,7 @@ import FC from '../fc'; import MSP from '../msp'; import MSPCodes from '../msp/MSPCodes'; import PortHandler, { usbDevices } from '../port_handler'; -import { API_VERSION_1_39, API_VERSION_1_45, API_VERSION_1_47 } from '../data_storage'; +import { API_VERSION_1_39, API_VERSION_1_45, API_VERSION_1_46 } from '../data_storage'; import serial from '../serial'; import STM32DFU from '../protocols/stm32usbdfu'; import { gui_log } from '../gui_log'; @@ -1303,7 +1303,7 @@ firmware_flasher.verifyBoard = function() { function getBoardInfo() { MSP.send_message(MSPCodes.MSP_BOARD_INFO, false, false, function() { - if (semver.gte(FC.CONFIG.apiVersion, API_VERSION_1_47)) { + if (semver.gte(FC.CONFIG.apiVersion, API_VERSION_1_46)) { FC.processBuildOptions(); self.cloudBuildOptions = FC.CONFIG.buildOptions; } @@ -1325,7 +1325,7 @@ firmware_flasher.verifyBoard = function() { // store FC.CONFIG.buildKey as the object gets destroyed after disconnect self.cloudBuildKey = FC.CONFIG.buildKey; - if (self.validateBuildKey() && semver.lt(FC.CONFIG.apiVersion, API_VERSION_1_47)) { + if (self.validateBuildKey() && semver.lt(FC.CONFIG.apiVersion, API_VERSION_1_46)) { self.buildApi.requestBuildOptions(self.cloudBuildKey, getCloudBuildOptions, getBoardInfo); } else { getBoardInfo();