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.
pull/267/head
Alberto García Hierro 7 years ago
parent 42f332e627
commit 5ea5399eb2

@ -464,7 +464,7 @@
"RX_SERIAL": {
"message": "Serial-based receiver (SPEKSAT, SBUS, SUMD)"
},
"RX_PARALLEL_PWM": {
"RX_PWM": {
"message": "PWM RX input (one wire per channel)"
},
"RX_MSP": {

@ -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 () {

Loading…
Cancel
Save