only:very-interesting-trigger-issue

This commit is contained in:
Andrey 2023-11-02 22:01:47 -04:00
parent 84f7508701
commit 2e59b9d7f1
1 changed files with 5 additions and 6 deletions

View File

@ -98,13 +98,12 @@ void setTriggerEmulatorRPM(int rpm) {
* All we need to do here is to change the periodMs
* togglePwmState() would see that the periodMs has changed and act accordingly
*/
float rPerSecond = NAN;
if (rpm != 0) {
float rpmM = getRpmMultiplier(getEngineRotationState()->getOperationMode());
rPerSecond = rpm * rpmM / 60.0; // per minute converted to per second
}
for (int channel = 0; channel < NUM_EMULATOR_CHANNELS; channel++) {
float rPerSecond = NAN;
if (rpm != 0) {
// use 0.5 multiplier for cam
float rpmM = (channel == 0) ? getRpmMultiplier(getEngineRotationState()->getOperationMode()) : 0.5f;
rPerSecond = rpm * rpmM / 60.0; // per minute converted to per second
}
triggerEmulatorSignals[channel].setFrequency(rPerSecond);
}