Skip to content

Commit

Permalink
Add buildOptions from MSP
Browse files Browse the repository at this point in the history
  • Loading branch information
haslinghuis committed Feb 1, 2024
1 parent da3a732 commit 2631404
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 0 deletions.
53 changes: 53 additions & 0 deletions src/js/fc.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,59 @@ const INITIAL_BATTERY_CONFIG = {
currentMeterSource: 0,
};

const BUILD_OPTIONS = {
// Radio Protocols
BUILD_OPTION_SERIALRX_CRSF: 4097,
BUILD_OPTION_SERIALRX_FPORT: 4098,
BUILD_OPTION_SERIALRX_GHST: 4099,
BUILD_OPTION_SERIALRX_IBUS: 4100,
BUILD_OPTION_SERIALRX_JETIEXBUS: 4101,
BUILD_OPTION_RX_PPM: 4102,
BUILD_OPTION_SERIALRX_SBUS: 4103,
BUILD_OPTION_SERIALRX_SPEKTRUM: 4104,
BUILD_OPTION_SERIALRX_SRXL2: 4105,
BUILD_OPTION_SERIALRX_SUMD: 4106,
BUILD_OPTION_SERIALRX_SUMH: 4107,
BUILD_OPTION_SERIALRX_XBUS: 4108,

// Motor Protocols
BUILD_OPTION_BRUSHED: 8230,
BUILD_OPTION_DSHOT: 8231,
BUILD_OPTION_MULTISHOT: 8232,
BUILD_OPTION_ONESHOT: 8233,
BUILD_OPTION_PROSHOT: 8234,
BUILD_OPTION_PWM_OUTPUT: 8235,

// Telemetry Protocols
BUILD_OPTION_TELEMETRY_FRSKY_HUB: 12301,
BUILD_OPTION_TELEMETRY_HOTT: 12302,
BUILD_OPTION_TELEMETRY_IBUS_EXTENDED: 12303,
BUILD_OPTION_TELEMETRY_LTM: 12304,
BUILD_OPTION_TELEMETRY_MAVLINK: 12305,
BUILD_OPTION_TELEMETRY_SMARTPORT: 12306,
BUILD_OPTION_TELEMETRY_SRXL: 12307,

// General Options
BUILD_OPTION_ACRO_TRAINER: 16404,
BUILD_OPTION_AKK_SMARTAUDIO: 16405,
BUILD_OPTION_BATTERY_CONTINUE: 16406,
BUILD_OPTION_CAMERA_CONTROL: 16407,
BUILD_OPTION_DASHBOARD: 16408,
BUILD_OPTION_EMFAT_TOOLS: 16409,
BUILD_OPTION_ESCSERIAL_SIMONK: 16410,
BUILD_OPTION_FRSKYOSD: 16411,
BUILD_OPTION_GPS: 16412,
BUILD_OPTION_LED_STRIP: 16413,
BUILD_OPTION_LED_STRIP_64: 16414,
BUILD_OPTION_MAG: 16415,
BUILD_OPTION_OSD_SD: 16416,
BUILD_OPTION_OSD_HD: 16417,
BUILD_OPTION_PINIO: 16418,
BUILD_OPTION_RACE_PRO: 16419,
BUILD_OPTION_SERVOS: 16420,
BUILD_OPTION_VTX: 16421,
};

const FC = {

// define all the global variables that are uses to hold FC state
Expand Down
3 changes: 3 additions & 0 deletions src/js/msp/MSPHelper.js
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 2631404

Please sign in to comment.