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

Update rx.c

This commit is contained in:
DaTwo 2015-05-07 02:50:27 -07:00
parent 862169807f
commit 38308020a1

View file

@ -388,18 +388,11 @@ void updateRSSIPWM(void)
// RSSI_Invert option
if (rxConfig->rssi_ppm_invert) {
if (pwmRssi < 1000) {
pwmRssi = 1000;
}
if (pwmRssi > 2000) {
pwmRssi = 2000;
}
pwmRssi = ((2000 - pwmRssi) + 1000);
pwmRssi = ((2000 - pwmRssi) + 1000);
}
// Range of rawPwmRssi is [1000;2000]. rssi should be in [0;1023];
rssi = (uint16_t)((constrain(pwmRssi - 1000, 0, 1000) / 1000.0f) * 1023.0f);
rssi = (uint16_t)((constrain(pwmRssi - 1000, 0, 1000) / 1000.0f) * 1023.0f);
}
#define RSSI_ADC_SAMPLE_COUNT 16