Skip to content

Commit

Permalink
Use firmware options
Browse files Browse the repository at this point in the history
  • Loading branch information
haslinghuis committed Apr 19, 2024
1 parent 939b88d commit 3368872
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/js/msp/MSPHelper.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
6 changes: 3 additions & 3 deletions src/js/serial_backend.js
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down Expand Up @@ -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();
}

Expand Down Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions src/js/tabs/firmware_flasher.js
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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;
}
Expand All @@ -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();
Expand Down

0 comments on commit 3368872

Please sign in to comment.