1
0
Fork 0
mirror of https://github.com/iNavFlight/inav-configurator.git synced 2025-07-23 16:25:19 +03:00

Fix values for PPM and PWM, rename RX_PARALLEL_PWM to RX_PWM

Name RX_PARALLEL_PWM was confusing, so it's been renamed to
just RX_PWM.
Values for RX_PWM and RX_PPM were swapper, they're now the correct
ones.
Set the order of the rx types as serial, ppm, pwm, spi, msp and none.
Allow versions using the feature bits to select RX_NONE by clearing
all relevant bits in the features.
This commit is contained in:
Alberto García Hierro 2017-10-07 10:47:22 +01:00
parent 42f332e627
commit 5ea5399eb2
2 changed files with 26 additions and 26 deletions

View file

@ -611,37 +611,35 @@ var FC = {
},
{
name: 'RX_PPM',
bit: 0,
value: 1,
},
{
name: 'RX_PARALLEL_PWM',
bit: 13,
value: 2,
},
{
name: 'RX_MSP',
bit: 14,
value: 4,
name: 'RX_PWM',
bit: 0,
value: 1,
},
];
if (semver.gte(CONFIG.apiVersion, "1.21.0")) {
rxTypes.push(
{
name: 'RX_SPI',
bit: 25,
value: 5,
},
);
}
if (semver.gt(CONFIG.flightControllerVersion, "1.7.3")) {
rxTypes.push(
{
name: 'RX_NONE',
value: 0,
},
);
rxTypes.push({
name: 'RX_SPI',
bit: 25,
value: 5,
});
}
rxTypes.push({
name: 'RX_MSP',
bit: 14,
value: 4,
});
rxTypes.push({
name: 'RX_NONE',
value: 0,
});
return rxTypes;
},
isRxTypeEnabled: function(rxType) {
@ -659,8 +657,10 @@ var FC = {
for (var ii = 0; ii < rxTypes.length; ii++) {
BF_CONFIG.features = bit_clear(BF_CONFIG.features, rxTypes[ii].bit);
}
// Set the feature for this rx type
BF_CONFIG.features = bit_set(BF_CONFIG.features, rxType.bit);
// Set the feature for this rx type (if any, RX_NONE is set by clearing all)
if (rxType.bit !== undefined) {
BF_CONFIG.features = bit_set(BF_CONFIG.features, rxType.bit);
}
}
},
getSerialRxTypes: function () {