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
3d-gussner 2021-09-08 19:33:08 +02:00 committed by DRracer
parent 1d1e2ef108
commit c0b776375d
1 changed files with 1 additions and 1 deletions

View File

@ -15,7 +15,7 @@ int8_t Buttons::DecodeADC(uint16_t rawADC) {
// Doesn't handle multiple pressed buttons at once
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;
}