Skip to content

Commit

Permalink
Hide telemetry protocols for CRSF, FPORT and GHST
Browse files Browse the repository at this point in the history
  • Loading branch information
haslinghuis committed Jan 5, 2024
1 parent adf380c commit ea07103
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/js/tabs/firmware_flasher.js
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,18 @@ firmware_flasher.initialize = function (callback) {
});
}

function toggleTelemetryProtocolInfo() {
const radioProtocol = $('select[name="radioProtocols"] option:selected').val();
const hasTelemetryEnabledByDefault = [
'USE_SERIALRX_CRSF',
'USE_SERIALRX_FPORT',
'USE_SERIALRX_GHST',
].includes(radioProtocol);

$('select[name="telemetryProtocols"]')
.attr('disabled', hasTelemetryEnabledByDefault);
}

function buildOptions(data) {
if (!navigator.onLine) {
return;
Expand All @@ -201,6 +213,8 @@ firmware_flasher.initialize = function (callback) {
if (!self.validateBuildKey()) {
preselectRadioProtocolFromStorage();
}

toggleTelemetryProtocolInfo();
}

function preselectRadioProtocolFromStorage() {
Expand Down Expand Up @@ -430,6 +444,8 @@ firmware_flasher.initialize = function (callback) {
if (selectedProtocol) {
setConfig({"ffRadioProtocol" : selectedProtocol});
}

toggleTelemetryProtocolInfo();
});

$('select[name="board"]').on('change', function() {
Expand Down

0 comments on commit ea07103

Please sign in to comment.