mirror of
https://github.com/betaflight/betaflight-configurator.git
synced 2025-07-27 02:05:21 +03:00
Add ELRS SPI Model Match ID (#4104)
* Add ELRS SPI Model Match ID * Fixes per review * Also gate saving
This commit is contained in:
parent
295e088aa5
commit
1cef9650cd
4 changed files with 33 additions and 2 deletions
|
@ -2191,6 +2191,12 @@
|
|||
"pidTuningSliderModeHelp": {
|
||||
"message": "<strong>Pid Tuning Slider Mode</strong><br><br>Pidtuning slider mode can be:<br><br>• OFF - no sliders, enter values manually<br>• RP - sliders control Roll and Pitch only, enter Yaw values manually<br>• RPY - sliders control all PID values<br><br><span class=\"message-negative\"><b>Warning:</b></span>Going from RP to RPY mode will overwrite Yaw settings with firmware settings."
|
||||
},
|
||||
"receiverHelpModelId": {
|
||||
"message": "If you set the Model Match below to a number other than 255, you can specify the receiver number in OpenTX/EdgeTX model setup page and turn on the Model Match in the ELRS LUA script for that model. Model match is between 0 and 63 inclusive.<br />See ELRS Documentation for more information."
|
||||
},
|
||||
"receiverModelId": {
|
||||
"message": "Model Match ID"
|
||||
},
|
||||
"receiverHelp": {
|
||||
"message": "• <b><strong><a href=\"https://betaflight.com/docs/wiki/guides/current/Failsafe#testing-failsafe\" target=\"_blank\" rel=\"noopener noreferrer\">Always check that your Failsafe is working properly!</a></strong></b> The settings are in the Failsafe tab, which requires Expert Mode.<br> • <b>Use the latest Tx firmware!</b><br> • <strong><a href=\"https://betaflight.com/docs/development/Rx#disabling-the-opentxedgetx-adc-filter\" target=\"_blank\" rel=\"noopener noreferrer\">Disable the hardware ADC filter</a></strong> in the Transmitter if using OpenTx or EdgeTx.<br>Basic Setup: Configure the 'Receiver' settings correctly. Choose the correct ‘Channel Map’ for your radio. Check that the Roll, Pitch and other bar graphs move correctly. Adjust the channel endpoint or range values in the transmitter to ~1000 to ~2000, and set the midpoint to 1500. For more information, read the <strong><a href=\"https://betaflight.com/docs/development/Rx\" target=\"_blank\" rel=\"noopener noreferrer\">documentation</a></strong>."
|
||||
},
|
||||
|
|
|
@ -8,7 +8,7 @@ import semver from 'semver';
|
|||
import vtxDeviceStatusFactory from "../utils/VtxDeviceStatus/VtxDeviceStatusFactory";
|
||||
import MSP from "../msp";
|
||||
import MSPCodes from "./MSPCodes";
|
||||
import { API_VERSION_1_45, API_VERSION_1_46 } from '../data_storage';
|
||||
import { API_VERSION_1_45, API_VERSION_1_46, API_VERSION_1_47 } from '../data_storage';
|
||||
import EscProtocols from "../utils/EscProtocols";
|
||||
import huffmanDecodeBuf from "../huffman";
|
||||
import { defaultHuffmanTree, defaultHuffmanLenIndex } from "../default_huffman_tree";
|
||||
|
@ -1014,6 +1014,10 @@ MspHelper.prototype.process_data = function(dataHandler) {
|
|||
}
|
||||
}
|
||||
|
||||
if (semver.gte(FC.CONFIG.apiVersion, API_VERSION_1_47)) {
|
||||
FC.RX_CONFIG.elrsModelId = data.readU8();
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case MSPCodes.MSP_FAILSAFE_CONFIG:
|
||||
|
@ -1906,6 +1910,11 @@ MspHelper.prototype.crunch = function(code, modifierCode = undefined) {
|
|||
FC.RX_CONFIG.elrsUid.forEach(b => buffer.push8(b));
|
||||
}
|
||||
|
||||
// Introduced in 1.47
|
||||
if (semver.gte(FC.CONFIG.apiVersion, API_VERSION_1_47)) {
|
||||
buffer.push8(FC.RX_CONFIG.elrsModelId);
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case MSPCodes.MSP_SET_FAILSAFE_CONFIG:
|
||||
|
|
|
@ -10,7 +10,7 @@ import Model from "../model";
|
|||
import RateCurve from "../RateCurve";
|
||||
import MSPCodes from "../msp/MSPCodes";
|
||||
import windowWatcherUtil from "../utils/window_watchers";
|
||||
import CONFIGURATOR, { API_VERSION_1_45, API_VERSION_1_46 } from "../data_storage";
|
||||
import CONFIGURATOR, { API_VERSION_1_45, API_VERSION_1_46, API_VERSION_1_47 } from "../data_storage";
|
||||
import DarkTheme from "../DarkTheme";
|
||||
import { gui_log } from "../gui_log";
|
||||
import { degToRad } from "../utils/common";
|
||||
|
@ -370,6 +370,13 @@ receiver.initialize = function (callback) {
|
|||
tab.elrsBindingPhraseEnabled = false;
|
||||
}
|
||||
|
||||
if (tab.elrsBindingPhraseEnabled && semver.gte(FC.CONFIG.apiVersion, API_VERSION_1_47)) {
|
||||
$('input[name="elrsModelId-number"]').val(FC.RX_CONFIG.elrsModelId);
|
||||
} else {
|
||||
$('input[name="elrsModelId-number"]').parent().hide();
|
||||
}
|
||||
|
||||
|
||||
// UI Hooks
|
||||
|
||||
function updateSaveButton(reboot=false) {
|
||||
|
@ -471,6 +478,10 @@ receiver.initialize = function (callback) {
|
|||
} else {
|
||||
FC.RX_CONFIG.elrsUid = [0, 0, 0, 0, 0, 0];
|
||||
}
|
||||
|
||||
if (semver.gte(FC.CONFIG.apiVersion, API_VERSION_1_47)) {
|
||||
FC.RX_CONFIG.elrsModelId = parseInt($('input[name="elrsModelId-number"]').val());
|
||||
}
|
||||
}
|
||||
|
||||
function save_rssi_config() {
|
||||
|
|
|
@ -60,6 +60,11 @@
|
|||
<div>
|
||||
<span class="elrsUid"></span>
|
||||
</div>
|
||||
<div class="number">
|
||||
<input type="number" name="elrsModelId-number" min="0" max="255"/>
|
||||
<span i18n="receiverModelId"></span>
|
||||
<div class="helpicon cf_tip" i18n_title="receiverHelpModelId"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue