mirror of
https://github.com/iNavFlight/inav-configurator.git
synced 2025-07-23 08:15:19 +03:00
Rename all references to NRF24 as protocol to SPI
For consistency. We now have other receivers that work over SPI and might have more in the future.
This commit is contained in:
parent
52c17cf8b7
commit
42f332e627
5 changed files with 24 additions and 27 deletions
|
@ -470,7 +470,7 @@
|
|||
"RX_MSP": {
|
||||
"message": "MSP RX input (control via MSP port)"
|
||||
},
|
||||
"RX_NRF24": {
|
||||
"RX_SPI": {
|
||||
"message": "RX SPI based receiver (NRF24L01, RFM22)"
|
||||
},
|
||||
"RX_NONE": {
|
||||
|
@ -729,7 +729,7 @@
|
|||
"configurationSerialRX": {
|
||||
"message": "Serial Receiver Provider"
|
||||
},
|
||||
"configurationNrf24Protocol": {
|
||||
"configurationSPIProtocol": {
|
||||
"message": "RX SPI protocol"
|
||||
},
|
||||
"configurationEepromSaved": {
|
||||
|
|
9
js/fc.js
9
js/fc.js
|
@ -355,8 +355,9 @@ var FC = {
|
|||
spektrum_sat_bind: 0,
|
||||
rx_min_usec: 0,
|
||||
rx_max_usec: 0,
|
||||
nrf24rx_protocol: 0,
|
||||
nrf24rx_id: 0
|
||||
spirx_protocol: 0,
|
||||
spirx_id: 0,
|
||||
spirx_channel_count: 0,
|
||||
};
|
||||
|
||||
POSITION_ESTIMATOR = {
|
||||
|
@ -627,7 +628,7 @@ var FC = {
|
|||
if (semver.gte(CONFIG.apiVersion, "1.21.0")) {
|
||||
rxTypes.push(
|
||||
{
|
||||
name: 'RX_NRF24',
|
||||
name: 'RX_SPI',
|
||||
bit: 25,
|
||||
value: 5,
|
||||
},
|
||||
|
@ -681,7 +682,7 @@ var FC = {
|
|||
|
||||
return data;
|
||||
},
|
||||
getNrf24ProtocolTypes: function () {
|
||||
getSPIProtocolTypes: function () {
|
||||
return [
|
||||
'V202 250Kbps',
|
||||
'V202 1Mbps',
|
||||
|
|
|
@ -589,11 +589,11 @@ var mspHelper = (function (gui) {
|
|||
offset += 2;
|
||||
if (semver.gte(CONFIG.apiVersion, "1.21.0")) {
|
||||
offset += 4; // 4 null bytes for betaflight compatibility
|
||||
RX_CONFIG.nrf24rx_protocol = data.getUint8(offset);
|
||||
RX_CONFIG.spirx_protocol = data.getUint8(offset);
|
||||
offset++;
|
||||
RX_CONFIG.nrf24rx_id = data.getUint32(offset, true);
|
||||
RX_CONFIG.spirx_id = data.getUint32(offset, true);
|
||||
offset += 4;
|
||||
RX_CONFIG.nrf24rx_channel_count = data.getUint8(offset);
|
||||
RX_CONFIG.spirx_channel_count = data.getUint8(offset);
|
||||
offset += 1;
|
||||
}
|
||||
if (semver.gt(CONFIG.flightControllerVersion, "1.7.3")) {
|
||||
|
@ -1172,14 +1172,10 @@ var mspHelper = (function (gui) {
|
|||
buffer.push(0);
|
||||
buffer.push(0);
|
||||
buffer.push(0);
|
||||
buffer.push(RX_CONFIG.nrf24rx_protocol);
|
||||
// nrf24rx_id - 4 bytes
|
||||
buffer.push(RX_CONFIG.nrf24rx_id & 0xFF);
|
||||
buffer.push((RX_CONFIG.nrf24rx_id >> 8) & 0xFF);
|
||||
buffer.push((RX_CONFIG.nrf24rx_id >> 16) & 0xFF);
|
||||
buffer.push((RX_CONFIG.nrf24rx_id >> 24) & 0xFF);
|
||||
|
||||
buffer.push(RX_CONFIG.nrf24rx_channel_count);
|
||||
buffer.push(RX_CONFIG.spirx_protocol);
|
||||
// spirx_id - 4 bytes
|
||||
buffer.push32(RX_CONFIG.spirx_id);
|
||||
buffer.push(RX_CONFIG.spirx_channel_count);
|
||||
}
|
||||
if (semver.gt(CONFIG.flightControllerVersion, "1.7.3")) {
|
||||
// unused byte for fpvCamAngleDegrees, for compatiblity with betaflight
|
||||
|
|
|
@ -133,9 +133,9 @@
|
|||
<!-- list generated here -->
|
||||
</select>
|
||||
</div>
|
||||
<div data-rx-type="RX_NRF24" class="spacer_box">
|
||||
<h3 data-i18n="configurationNrf24Protocol"></h3>
|
||||
<select id="nrf24-protocol" class="full-width" size="1">
|
||||
<div data-rx-type="RX_SPI" class="spacer_box">
|
||||
<h3 data-i18n="configurationSPIProtocol"></h3>
|
||||
<select id="spi-protocol" class="full-width" size="1">
|
||||
<!-- list generated here -->
|
||||
</select>
|
||||
</div>
|
||||
|
|
|
@ -260,16 +260,16 @@ TABS.configuration.initialize = function (callback, scrollPosition) {
|
|||
//noinspection JSValidateTypes
|
||||
$('#content').scrollTop((scrollPosition) ? scrollPosition : 0);
|
||||
|
||||
var nrf24Protocol_e = $('#nrf24-protocol');
|
||||
GUI.fillSelect(nrf24Protocol_e, FC.getNrf24ProtocolTypes());
|
||||
var spiProtocol_e = $('#spi-protocol');
|
||||
GUI.fillSelect(spiProtocol_e, FC.getSPIProtocolTypes());
|
||||
|
||||
nrf24Protocol_e.change(function () {
|
||||
RX_CONFIG.nrf24rx_protocol = parseInt($(this).val());
|
||||
RX_CONFIG.nrf24rx_id = 0;
|
||||
spiProtocol_e.change(function () {
|
||||
RX_CONFIG.spirx_protocol = parseInt($(this).val());
|
||||
RX_CONFIG.spirx_id = 0;
|
||||
});
|
||||
|
||||
// select current nrf24 protocol
|
||||
nrf24Protocol_e.val(RX_CONFIG.nrf24rx_protocol);
|
||||
// select current spi protocol
|
||||
spiProtocol_e.val(RX_CONFIG.spirx_protocol);
|
||||
|
||||
// fill board alignment
|
||||
$('input[name="board_align_roll"]').val((BF_CONFIG.board_align_roll / 10.0).toFixed(1));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue