Merge pull request #2370 from opentx/projectkk2glider/issue_2364_s3_ghost_readings_for_next
Fixes #2364: use fixed analog value for non-connected pots (ported fr…
This commit is contained in:
@@ -165,6 +165,12 @@ void adcStop()
|
|||||||
|
|
||||||
uint16_t getAnalogValue(uint32_t index)
|
uint16_t getAnalogValue(uint32_t index)
|
||||||
{
|
{
|
||||||
|
if (IS_POT(index) && !IS_POT_AVAILABLE(index)) {
|
||||||
|
// Use fixed analog value for non-existing and/or non-connected pots.
|
||||||
|
// Non-connected analog inputs will slightly follow the adjacent connected analog inputs,
|
||||||
|
// which produces ghost readings on these inputs.
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
#if defined(REV9E)
|
#if defined(REV9E)
|
||||||
index = ana_mapping[index];
|
index = ana_mapping[index];
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Reference in New Issue
Block a user