1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-25 17:25:20 +03:00

Failsafe - Remove magic number usage. Cleanup whitespace

This commit is contained in:
Dominic Clifton 2015-08-03 16:58:49 +01:00
parent 8e79a117d1
commit 3436b08575
4 changed files with 20 additions and 17 deletions

View file

@ -311,18 +311,18 @@ static uint16_t calculateNonDataDrivenChannel(uint8_t chan, uint16_t sample)
return rcDataMean[chan] / PPM_AND_PWM_SAMPLE_COUNT;
}
static uint16_t getRxfailValue(uint8_t chan)
static uint16_t getRxfailValue(uint8_t channel)
{
switch (chan) {
case ROLL:
case PITCH:
case YAW:
return rxConfig->midrc;
case THROTTLE:
if (feature(FEATURE_3D)) return rxConfig->midrc;
else return rxConfig->rx_min_usec;
default:
return RXFAIL_STEP_TO_CHANNEL_VALUE(rxConfig->rx_fail_usec_steps[chan-4]);
switch (channel) {
case ROLL:
case PITCH:
case YAW:
return rxConfig->midrc;
case THROTTLE:
if (feature(FEATURE_3D)) return rxConfig->midrc;
else return rxConfig->rx_min_usec;
default:
return RXFAIL_STEP_TO_CHANNEL_VALUE(rxConfig->rx_fail_usec_steps[channel - NON_AUX_CHANNEL_COUNT]);
}
}