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

RSSI_ADC configurable scale in CLI

This commit is contained in:
Pierre-A 2014-10-30 21:29:56 +01:00
parent 84384e61af
commit 3592429ed5
4 changed files with 9 additions and 2 deletions

View file

@ -347,7 +347,7 @@ void updateRSSIPWM(void)
}
#define RSSI_ADC_SAMPLE_COUNT 16
#define RSSI_SCALE (0xFFF / 100.0f)
//#define RSSI_SCALE (0xFFF / 100.0f)
void updateRSSIADC(uint32_t currentTime)
{
@ -362,7 +362,7 @@ void updateRSSIADC(uint32_t currentTime)
int16_t adcRssiMean = 0;
uint16_t adcRssiSample = adcGetChannel(ADC_RSSI);
uint8_t rssiPercentage = adcRssiSample / RSSI_SCALE;
uint8_t rssiPercentage = adcRssiSample / rxConfig->rssi_scale;
adcRssiSampleIndex = (adcRssiSampleIndex + 1) % RSSI_ADC_SAMPLE_COUNT;