Fix off-by-one error.
This commit is contained in:
parent
145e383bc5
commit
82927519ce
1 changed files with 2 additions and 2 deletions
|
@ -133,13 +133,13 @@ bool EncoderButton::Update(Joystick* js) {
|
||||||
ticks--;
|
ticks--;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ticks > tick_threshold) {
|
if (ticks >= tick_threshold) {
|
||||||
js->PressButton(vbutton);
|
js->PressButton(vbutton);
|
||||||
changed = true;
|
changed = true;
|
||||||
release_time1 = millis() + 250;
|
release_time1 = millis() + 250;
|
||||||
ticks = 0;
|
ticks = 0;
|
||||||
}
|
}
|
||||||
else if (ticks < tick_threshold * -1) {
|
else if (ticks <= tick_threshold * -1) {
|
||||||
js->PressButton(vbutton2);
|
js->PressButton(vbutton2);
|
||||||
changed = true;
|
changed = true;
|
||||||
release_time2 = millis() + 250;
|
release_time2 = millis() + 250;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue