mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-15 12:25:20 +03:00
Failsafe - Add rxfail auto
mode. Allow rxfail to be used for all
channels, not just aux channel.
This commit is contained in:
parent
5142ff032a
commit
a030d4dd9e
6 changed files with 105 additions and 61 deletions
|
@ -1171,10 +1171,10 @@ static bool processOutCommand(uint8_t cmdMSP)
|
|||
break;
|
||||
|
||||
case MSP_RXFAIL_CONFIG:
|
||||
headSerialReply(3 * (rxRuntimeConfig.channelCount - NON_AUX_CHANNEL_COUNT));
|
||||
for (i = NON_AUX_CHANNEL_COUNT; i < rxRuntimeConfig.channelCount; i++) {
|
||||
serialize8(masterConfig.rxConfig.failsafe_aux_channel_configurations[i - NON_AUX_CHANNEL_COUNT].mode);
|
||||
serialize16(RXFAIL_STEP_TO_CHANNEL_VALUE(masterConfig.rxConfig.failsafe_aux_channel_configurations[i - NON_AUX_CHANNEL_COUNT].step));
|
||||
headSerialReply(3 * (rxRuntimeConfig.channelCount));
|
||||
for (i = 0; i < rxRuntimeConfig.channelCount; i++) {
|
||||
serialize8(masterConfig.rxConfig.failsafe_channel_configurations[i].mode);
|
||||
serialize16(RXFAIL_STEP_TO_CHANNEL_VALUE(masterConfig.rxConfig.failsafe_channel_configurations[i].step));
|
||||
}
|
||||
break;
|
||||
|
||||
|
@ -1606,12 +1606,12 @@ static bool processInCommand(void)
|
|||
case MSP_SET_RXFAIL_CONFIG:
|
||||
{
|
||||
uint8_t channelCount = currentPort->dataSize / 3;
|
||||
if (channelCount > MAX_AUX_CHANNEL_COUNT) {
|
||||
if (channelCount > MAX_SUPPORTED_RC_CHANNEL_COUNT) {
|
||||
headSerialError(0);
|
||||
} else {
|
||||
for (i = NON_AUX_CHANNEL_COUNT; i < channelCount; i++) {
|
||||
masterConfig.rxConfig.failsafe_aux_channel_configurations[i - NON_AUX_CHANNEL_COUNT].mode = read8();
|
||||
masterConfig.rxConfig.failsafe_aux_channel_configurations[i - NON_AUX_CHANNEL_COUNT].step = CHANNEL_VALUE_TO_RXFAIL_STEP(read16());
|
||||
for (i = 0; i < channelCount; i++) {
|
||||
masterConfig.rxConfig.failsafe_channel_configurations[i].mode = read8();
|
||||
masterConfig.rxConfig.failsafe_channel_configurations[i].step = CHANNEL_VALUE_TO_RXFAIL_STEP(read16());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue