Merge pull request #614 from mikeller/added_spi_rx_config

Added UI for SPI RX configuration.
10.3.x-maintenance
Michael Keller 2017-08-17 19:13:43 +12:00 committed by GitHub
commit d1f68d5bc1
5 changed files with 60 additions and 3 deletions

View File

@ -550,7 +550,10 @@
"featureBLACKBOXTip": {
"message": "Configure via the BlackBox tab after enabling."
},
"featureESC_SENSOR": {
"featureRX_SPI": {
"message": "SPI RX support"
},
"featureESC_SENSOR": {
"message": "Use KISS/BLHeli_32 ESC telemetry as sensor"
},
"featureCHANNEL_FORWARDING": {
@ -631,6 +634,9 @@
"configurationSerialRXHelp": {
"message": "<strong>Note:</strong> Remember to configure a Serial Port (via Ports tab) and choose a Serial Receiver Provider when using RX_SERIAL feature."
},
"configurationSpiRxHelp": {
"message": "<strong>Note:</strong> The SPI RX provider will only work if the required hardware is on board or connected to an SPI bus."
},
"configurationOtherFeaturesHelp": {
"message": "<strong>Note:</strong> Some of the features of the firmware are not shown in this list any more, because they have been moved to other places in the configurator."
},
@ -811,6 +817,9 @@
"configurationSerialRX": {
"message": "Serial Receiver Provider"
},
"configurationSpiRx": {
"message": "SPI Bus Receiver Provider"
},
"configurationEepromSaved": {
"message": "EEPROM <span style=\"color: #ffbb00\">saved</span>"
},

View File

@ -79,6 +79,7 @@ var Features = function (config) {
if (semver.gte(CONFIG.apiVersion, "1.31.0")) {
features.push(
{bit: 25, group: 'rxMode', mode: 'select', name: 'RX_SPI'},
{bit: 27, group: 'other', name: 'ESC_SENSOR'}
);
}

View File

@ -314,11 +314,11 @@
width: 30px;
}
.tab-configuration .serialRXBox {
.tab-configuration .serialRXBox, .spiRxBox {
padding-top: 0px;
}
.tab-configuration .serialRX, .rxMode {
.tab-configuration .serialRX, .spiRx, .rxMode {
border: 1px solid silver;
width: 230px;
float: left;

View File

@ -345,6 +345,17 @@
</select>
<span i18n="configurationSerialRX"></span>
</div>
<div class="spiRxBox spacer_box" style="padding-bottom:10px;">
<div class="note spacerbottom">
<div class="note_spacer">
<p i18n="configurationSpiRxHelp"></p>
</div>
</div>
<select class="spiRx">
<!-- list generated here -->
</select>
<span i18n="configurationSpiRX"></span>
</div>
</div>
</div>

View File

@ -558,6 +558,32 @@ TABS.configuration.initialize = function (callback, scrollPosition) {
// select current serial RX type
serialRX_e.val(RX_CONFIG.serialrx_provider);
if (semver.gte(CONFIG.apiVersion, "1.31.0")) {
var spiRxTypes = [
'NRF24_V202_250K',
'NRF24_V202_1M',
'NRF24_SYMA_X',
'NRF24_SYMA_X5C',
'NRF24_CX10',
'CX10A',
'NRF24_H8_3D',
'NRF24_INAV',
'FRSKY_D'
];
var spiRx_e = $('select.spiRx');
for (var i = 0; i < spiRxTypes.length; i++) {
spiRx_e.append('<option value="' + i + '">' + spiRxTypes[i] + '</option>');
}
spiRx_e.change(function () {
RX_CONFIG.rxSpiProtocol = parseInt($(this).val());
});
// select current serial RX type
spiRx_e.val(RX_CONFIG.rxSpiProtocol);
}
// for some odd reason chrome 38+ changes scroll according to the touched select element
// i am guessing this is a bug, since this wasn't happening on 37
// code below is a temporary fix, which we will be able to remove in the future (hopefully)
@ -711,6 +737,14 @@ TABS.configuration.initialize = function (callback, scrollPosition) {
}
}
function checkShowSpiRxBox() {
if (FEATURE_CONFIG.features.isEnabled('RX_SPI')) {
$('div.spiRxBox').show();
} else {
$('div.spiRxBox').hide();
}
}
function checkUpdateGpsControls() {
if (FEATURE_CONFIG.features.isEnabled('GPS')) {
$('.gpsSettings').show();
@ -771,6 +805,7 @@ TABS.configuration.initialize = function (callback, scrollPosition) {
switch (element.attr('name')) {
case 'rxMode':
checkShowSerialRxBox();
checkShowSpiRxBox();
break;
default:
@ -785,6 +820,7 @@ TABS.configuration.initialize = function (callback, scrollPosition) {
checkShowDisarmDelay();
checkShowSerialRxBox();
checkShowSpiRxBox();
checkUpdateGpsControls();
checkUpdate3dControls();