mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-20 00:51:42 +00:00
Revert change in behavior in HeldButtonScheduler (#1381)
Originally, the command was restarted every time the scheduler was executed if the button was pressed. #1340 changed this behavior in a breaking manner.
This commit is contained in:
committed by
Peter Johnson
parent
7c1a7332e1
commit
0a2ab4f0d7
@@ -19,7 +19,7 @@ HeldButtonScheduler::HeldButtonScheduler(bool last, Trigger* button,
|
||||
void HeldButtonScheduler::Execute() {
|
||||
bool pressed = m_button->Grab();
|
||||
|
||||
if (!m_pressedLast && pressed) {
|
||||
if (pressed) {
|
||||
m_command->Start();
|
||||
} else if (m_pressedLast && !pressed) {
|
||||
m_command->Cancel();
|
||||
|
||||
Reference in New Issue
Block a user