From 8ef31979ebd335b10c361e0444dc8a23bd68275b Mon Sep 17 00:00:00 2001 From: Mark Haslinghuis Date: Thu, 1 Feb 2024 00:50:02 +0100 Subject: [PATCH] Add buildOptions from MSP --- src/js/fc.js | 53 +++++++++++++++++++++++++++++++++++++++++ src/js/msp/MSPHelper.js | 3 +++ 2 files changed, 56 insertions(+) diff --git a/src/js/fc.js b/src/js/fc.js index df15a2a2e13..d8dd2d0f1e8 100644 --- a/src/js/fc.js +++ b/src/js/fc.js @@ -67,6 +67,59 @@ const INITIAL_BATTERY_CONFIG = { currentMeterSource: 0, }; +const BUILD_OPTIONS = { + // Radio Protocols + USE_SERIALRX_CRSF: 4097, + USE_SERIALRX_FPORT: 4098, + USE_SERIALRX_GHST: 4099, + USE_SERIALRX_IBUS: 4100, + USE_SERIALRX_JETIEXBUS: 4101, + USE_RX_PPM: 4102, + USE_SERIALRX_SBUS: 4103, + USE_SERIALRX_SPEKTRUM: 4104, + USE_SERIALRX_SRXL2: 4105, + USE_SERIALRX_SUMD: 4106, + USE_SERIALRX_SUMH: 4107, + USE_SERIALRX_XBUS: 4108, + + // Motor Protocols + USE_BRUSHED: 8230, + USE_DSHOT: 8231, + USE_MULTISHOT: 8232, + USE_ONESHOT: 8233, + USE_PROSHOT: 8234, + USE_PWM_OUTPUT: 8235, + + // Telemetry Protocols + USE_TELEMETRY_FRSKY_HUB: 12301, + USE_TELEMETRY_HOTT: 12302, + USE_TELEMETRY_IBUS_EXTENDED:12303, + USE_TELEMETRY_LTM: 12304, + USE_TELEMETRY_MAVLINK: 12305, + USE_TELEMETRY_SMARTPORT: 12306, + USE_TELEMETRY_SRXL: 12307, + + // General Options + USE_ACRO_TRAINER: 16404, + USE_AKK_SMARTAUDIO: 16405, + USE_BATTERY_CONTINUE: 16406, + USE_CAMERA_CONTROL: 16407, + USE_DASHBOARD: 16408, + USE_EMFAT_TOOLS: 16409, + USE_ESCSERIAL_SIMONK: 16410, + USE_FRSKYOSD: 16411, + USE_GPS: 16412, + USE_LED_STRIP: 16413, + USE_LED_STRIP_64: 16414, + USE_MAG: 16415, + USE_OSD_SD: 16416, + USE_OSD_HD: 16417, + USE_PINIO: 16418, + USE_RACE_PRO: 16419, + USE_SERVOS: 16420, + USE_VTX: 16421, +}; + const FC = { // define all the global variables that are uses to hold FC state diff --git a/src/js/msp/MSPHelper.js b/src/js/msp/MSPHelper.js index 0b74823a774..c71f8d4619b 100644 --- a/src/js/msp/MSPHelper.js +++ b/src/js/msp/MSPHelper.js @@ -782,6 +782,9 @@ MspHelper.prototype.process_data = function(dataHandler) { buff.push(data.readU8()); } FC.CONFIG.buildInfo = String.fromCharCode.apply(null, buff); + if (semver.gte(FC.CONFIG.apiVersion, API_VERSION_1_46)) { + FC.CONFIG.buildOptions = data.readU16(); + } break; case MSPCodes.MSP_BOARD_INFO: