Fix right button issue on some hardware
My MM-control-board v0.3 has following ADC readings in DEBUG_BUTTONS - none = 1023 - left = 169 - mid = 91-92 - right = 0 As the comparison was larger than 0 MY MMU2 right button wasn't detected.pull/121/head
parent
1d1e2ef108
commit
c0b776375d
|
|
@ -15,7 +15,7 @@ int8_t Buttons::DecodeADC(uint16_t rawADC) {
|
||||||
// Doesn't handle multiple pressed buttons at once
|
// Doesn't handle multiple pressed buttons at once
|
||||||
|
|
||||||
for (int8_t buttonIndex = 0; buttonIndex < config::buttonCount; ++buttonIndex) {
|
for (int8_t buttonIndex = 0; buttonIndex < config::buttonCount; ++buttonIndex) {
|
||||||
if (rawADC > config::buttonADCLimits[buttonIndex][0] && rawADC <= config::buttonADCLimits[buttonIndex][1])
|
if (rawADC >= config::buttonADCLimits[buttonIndex][0] && rawADC <= config::buttonADCLimits[buttonIndex][1])
|
||||||
return buttonIndex;
|
return buttonIndex;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue