Fix: Initialize lastGearValue to prevent unwanted setResistance on init (#4018) - #4156
Fix: Initialize lastGearValue to prevent unwanted setResistance on init (#4018)#4156cagnulein wants to merge 1 commit into
Conversation
…it (#4018) Problem: - lastGearValue was initialized to -1 (default) - During init, it was not set to the current gears() value - On first update after init, the condition "lastGearValue != gears()" was always true (-1 != 0) - This caused an unwanted setResistance command (0x40 0x5b 0x3f) to be sent immediately after setSimMode Solution: - Initialize lastGearValue = gears() during init (line 264) - This prevents false gear change detection on first update - setResistance is now only sent when there's an actual gear change Fixes issue #4018 - Resistance Changes when Virtual Shifting
|
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
|
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
|
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
|
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
|
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
|
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
|
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
|
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Problem:
was always true (-1 != 0)
sent immediately after setSimMode
Solution:
Fixes issue #4018 - Resistance Changes when Virtual Shifting