Skip to content

Commit

Permalink
Update OpenFIREFeedback.cpp - disable rumble if trigger is released i…
Browse files Browse the repository at this point in the history
…n Autofire mode
  • Loading branch information
lemmingDev authored Jul 4, 2024
1 parent d0bf78d commit f4fc5a4
Showing 1 changed file with 15 additions and 6 deletions.
21 changes: 15 additions & 6 deletions SamcoEnhanced/OpenFIREFeedback.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -118,12 +118,21 @@ void FFB::FFBRelease()
}
}
}

if(rumbleHappening) { // Are we currently in a rumble command? (Implicitly needs SamcoPreferences::toggles.rumbleActive)
RumbleActivation(); // Continue processing our rumble command.
// (This is to prevent making the lack of trigger pull actually activate a rumble command instead of skipping it like we should.)
} else if(rumbleHappened) { // If rumble has happened,
rumbleHappened = false; // well we're clear now that we've stopped holding.

// If Rumble FF is enabled and Autofire is enabled, the motor needs to be disabled when the trigger is released. Otherwiseallow RumbleActivation to deal with the activation timer
if(SamcoPreferences::toggles.rumbleFF && SamcoPreferences::toggles.autofireActive) {
if(rumbleHappening || rumbleHappened) {
digitalWrite(SamcoPreferences::pins.oRumble, LOW); // Make sure the rumble is OFF.
rumbleHappening = false; // This rumble command is done now.
rumbleHappened = false; // Make it clear we've stopped holding.
}
} else {
if(rumbleHappening) { // Are we currently in a rumble command? (Implicitly needs SamcoPreferences::toggles.rumbleActive)
RumbleActivation(); // Continue processing our rumble command.
// (This is to prevent making the lack of trigger pull actually activate a rumble command instead of skipping it like we should.)
} else if(rumbleHappened) { // If rumble has happened,
rumbleHappened = false; // well we're clear now that we've stopped holding.
}
}
}

Expand Down

0 comments on commit f4fc5a4

Please sign in to comment.