mirror of
https://github.com/iNavFlight/inav-configurator.git
synced 2025-07-24 00:35:20 +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": {
|
"RX_MSP": {
|
||||||
"message": "MSP RX input (control via MSP port)"
|
"message": "MSP RX input (control via MSP port)"
|
||||||
},
|
},
|
||||||
"RX_NRF24": {
|
"RX_SPI": {
|
||||||
"message": "RX SPI based receiver (NRF24L01, RFM22)"
|
"message": "RX SPI based receiver (NRF24L01, RFM22)"
|
||||||
},
|
},
|
||||||
"RX_NONE": {
|
"RX_NONE": {
|
||||||
|
@ -729,7 +729,7 @@
|
||||||
"configurationSerialRX": {
|
"configurationSerialRX": {
|
||||||
"message": "Serial Receiver Provider"
|
"message": "Serial Receiver Provider"
|
||||||
},
|
},
|
||||||
"configurationNrf24Protocol": {
|
"configurationSPIProtocol": {
|
||||||
"message": "RX SPI protocol"
|
"message": "RX SPI protocol"
|
||||||
},
|
},
|
||||||
"configurationEepromSaved": {
|
"configurationEepromSaved": {
|
||||||
|
|
9
js/fc.js
9
js/fc.js
|
@ -355,8 +355,9 @@ var FC = {
|
||||||
spektrum_sat_bind: 0,
|
spektrum_sat_bind: 0,
|
||||||
rx_min_usec: 0,
|
rx_min_usec: 0,
|
||||||
rx_max_usec: 0,
|
rx_max_usec: 0,
|
||||||
nrf24rx_protocol: 0,
|
spirx_protocol: 0,
|
||||||
nrf24rx_id: 0
|
spirx_id: 0,
|
||||||
|
spirx_channel_count: 0,
|
||||||
};
|
};
|
||||||
|
|
||||||
POSITION_ESTIMATOR = {
|
POSITION_ESTIMATOR = {
|
||||||
|
@ -627,7 +628,7 @@ var FC = {
|
||||||
if (semver.gte(CONFIG.apiVersion, "1.21.0")) {
|
if (semver.gte(CONFIG.apiVersion, "1.21.0")) {
|
||||||
rxTypes.push(
|
rxTypes.push(
|
||||||
{
|
{
|
||||||
name: 'RX_NRF24',
|
name: 'RX_SPI',
|
||||||
bit: 25,
|
bit: 25,
|
||||||
value: 5,
|
value: 5,
|
||||||
},
|
},
|
||||||
|
@ -681,7 +682,7 @@ var FC = {
|
||||||
|
|
||||||
return data;
|
return data;
|
||||||
},
|
},
|
||||||
getNrf24ProtocolTypes: function () {
|
getSPIProtocolTypes: function () {
|
||||||
return [
|
return [
|
||||||
'V202 250Kbps',
|
'V202 250Kbps',
|
||||||
'V202 1Mbps',
|
'V202 1Mbps',
|
||||||
|
|
|
@ -589,11 +589,11 @@ var mspHelper = (function (gui) {
|
||||||
offset += 2;
|
offset += 2;
|
||||||
if (semver.gte(CONFIG.apiVersion, "1.21.0")) {
|
if (semver.gte(CONFIG.apiVersion, "1.21.0")) {
|
||||||
offset += 4; // 4 null bytes for betaflight compatibility
|
offset += 4; // 4 null bytes for betaflight compatibility
|
||||||
RX_CONFIG.nrf24rx_protocol = data.getUint8(offset);
|
RX_CONFIG.spirx_protocol = data.getUint8(offset);
|
||||||
offset++;
|
offset++;
|
||||||
RX_CONFIG.nrf24rx_id = data.getUint32(offset, true);
|
RX_CONFIG.spirx_id = data.getUint32(offset, true);
|
||||||
offset += 4;
|
offset += 4;
|
||||||
RX_CONFIG.nrf24rx_channel_count = data.getUint8(offset);
|
RX_CONFIG.spirx_channel_count = data.getUint8(offset);
|
||||||
offset += 1;
|
offset += 1;
|
||||||
}
|
}
|
||||||
if (semver.gt(CONFIG.flightControllerVersion, "1.7.3")) {
|
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(0);
|
||||||
buffer.push(0);
|
buffer.push(0);
|
||||||
buffer.push(RX_CONFIG.nrf24rx_protocol);
|
buffer.push(RX_CONFIG.spirx_protocol);
|
||||||
// nrf24rx_id - 4 bytes
|
// spirx_id - 4 bytes
|
||||||
buffer.push(RX_CONFIG.nrf24rx_id & 0xFF);
|
buffer.push32(RX_CONFIG.spirx_id);
|
||||||
buffer.push((RX_CONFIG.nrf24rx_id >> 8) & 0xFF);
|
buffer.push(RX_CONFIG.spirx_channel_count);
|
||||||
buffer.push((RX_CONFIG.nrf24rx_id >> 16) & 0xFF);
|
|
||||||
buffer.push((RX_CONFIG.nrf24rx_id >> 24) & 0xFF);
|
|
||||||
|
|
||||||
buffer.push(RX_CONFIG.nrf24rx_channel_count);
|
|
||||||
}
|
}
|
||||||
if (semver.gt(CONFIG.flightControllerVersion, "1.7.3")) {
|
if (semver.gt(CONFIG.flightControllerVersion, "1.7.3")) {
|
||||||
// unused byte for fpvCamAngleDegrees, for compatiblity with betaflight
|
// unused byte for fpvCamAngleDegrees, for compatiblity with betaflight
|
||||||
|
|
|
@ -133,9 +133,9 @@
|
||||||
<!-- list generated here -->
|
<!-- list generated here -->
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
<div data-rx-type="RX_NRF24" class="spacer_box">
|
<div data-rx-type="RX_SPI" class="spacer_box">
|
||||||
<h3 data-i18n="configurationNrf24Protocol"></h3>
|
<h3 data-i18n="configurationSPIProtocol"></h3>
|
||||||
<select id="nrf24-protocol" class="full-width" size="1">
|
<select id="spi-protocol" class="full-width" size="1">
|
||||||
<!-- list generated here -->
|
<!-- list generated here -->
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -260,16 +260,16 @@ TABS.configuration.initialize = function (callback, scrollPosition) {
|
||||||
//noinspection JSValidateTypes
|
//noinspection JSValidateTypes
|
||||||
$('#content').scrollTop((scrollPosition) ? scrollPosition : 0);
|
$('#content').scrollTop((scrollPosition) ? scrollPosition : 0);
|
||||||
|
|
||||||
var nrf24Protocol_e = $('#nrf24-protocol');
|
var spiProtocol_e = $('#spi-protocol');
|
||||||
GUI.fillSelect(nrf24Protocol_e, FC.getNrf24ProtocolTypes());
|
GUI.fillSelect(spiProtocol_e, FC.getSPIProtocolTypes());
|
||||||
|
|
||||||
nrf24Protocol_e.change(function () {
|
spiProtocol_e.change(function () {
|
||||||
RX_CONFIG.nrf24rx_protocol = parseInt($(this).val());
|
RX_CONFIG.spirx_protocol = parseInt($(this).val());
|
||||||
RX_CONFIG.nrf24rx_id = 0;
|
RX_CONFIG.spirx_id = 0;
|
||||||
});
|
});
|
||||||
|
|
||||||
// select current nrf24 protocol
|
// select current spi protocol
|
||||||
nrf24Protocol_e.val(RX_CONFIG.nrf24rx_protocol);
|
spiProtocol_e.val(RX_CONFIG.spirx_protocol);
|
||||||
|
|
||||||
// fill board alignment
|
// fill board alignment
|
||||||
$('input[name="board_align_roll"]').val((BF_CONFIG.board_align_roll / 10.0).toFixed(1));
|
$('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