Fixes #2364: use fixed analog value for non-connected pots (ported from master)

This commit is contained in:
Damjan Adamic
2015-06-17 10:34:16 +02:00
parent 0b44e10e0f
commit 873871d9f4
+6
View File
@@ -165,6 +165,12 @@ void adcStop()
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)
index = ana_mapping[index];
#endif