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:
parent
84384e61af
commit
3592429ed5
4 changed files with 9 additions and 2 deletions
|
@ -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;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue