revert unecessary change

This commit is contained in:
interfisch 2019-12-12 21:49:58 +01:00
parent a3a7122610
commit 767ffc188b
1 changed files with 4 additions and 4 deletions

View File

@ -383,7 +383,7 @@ void handleInputs()
timebuttonpressed_trigger=loopmillis; //set time of button press
timebuttonpressed_trigger_long=loopmillis; //set time of button press, for long hold timing
}else if(timebuttonpressed_trigger != 0 && digitalRead(PIN_TRIGGER)){ //button released (was pressed)
if (loopmillis-timebuttonpressed_trigger < BUTTONTIMEHOLD && timebuttonpressed_trigger>0){ //short press
if (loopmillis-timebuttonpressed_trigger < BUTTONTIMEHOLD){ //short press
button_trigger=true;
}
timebuttonpressed_trigger=0; //re-enable after short press and release from hold
@ -402,7 +402,7 @@ void handleInputs()
if (timebuttonpressed_left == 0 && !digitalRead(PIN_BTNLEFT)){ //first time pressed down. (low when pressed)
timebuttonpressed_left=loopmillis; //set time of button press
}else if(timebuttonpressed_left != 0 && digitalRead(PIN_BTNLEFT)){ //button released (was pressed)
if (loopmillis-timebuttonpressed_left < BUTTONTIMEHOLD && timebuttonpressed_left>0){ //short press
if (loopmillis-timebuttonpressed_left < BUTTONTIMEHOLD){ //short press
button_left=true;
}
timebuttonpressed_left=0; //re-enable after short press and release from hold
@ -415,7 +415,7 @@ void handleInputs()
if (timebuttonpressed_center == 0 && !digitalRead(PIN_BTNCENTER)){ //first time pressed down. (low when pressed)
timebuttonpressed_center=loopmillis; //set time of button press
}else if(timebuttonpressed_center != 0 && digitalRead(PIN_BTNCENTER)){ //button released (was pressed)
if (loopmillis-timebuttonpressed_center < BUTTONTIMEHOLD && timebuttonpressed_center>0){ //short press
if (loopmillis-timebuttonpressed_center < BUTTONTIMEHOLD){ //short press
button_center=true;
}
timebuttonpressed_center=0; //re-enable after short press and release from hold
@ -428,7 +428,7 @@ void handleInputs()
if (timebuttonpressed_right == 0 && !digitalRead(PIN_BTNRIGHT)){ //first time pressed down. (low when pressed)
timebuttonpressed_right=loopmillis; //set time of button press
}else if(timebuttonpressed_right != 0 && digitalRead(PIN_BTNRIGHT)){ //button released (was pressed)
if (loopmillis-timebuttonpressed_right < BUTTONTIMEHOLD && timebuttonpressed_right>0){ //short press
if (loopmillis-timebuttonpressed_right < BUTTONTIMEHOLD){ //short press
button_right=true;
}
timebuttonpressed_right=0; //re-enable after short press and release from hold