Skip to content

Fix Motor toy never scheduling its kickstart/max-runtime alarms#55

Merged
jsm174 merged 1 commit into
vpinball:masterfrom
dynajoe:fix/motor-alarm-safety
Jul 6, 2026
Merged

Fix Motor toy never scheduling its kickstart/max-runtime alarms#55
jsm174 merged 1 commit into
vpinball:masterfrom
dynajoe:fix/motor-alarm-safety

Conversation

@dynajoe

@dynajoe dynajoe commented Jul 5, 2026

Copy link
Copy Markdown
Contributor

Fix

Motor's five AlarmHandler register/unregister sites were empty if (m_alarmHandler != nullptr) {} stubs. Wire them to schedule KickStartEnd (kickstart duration) and MaxRunTimeMotorStop (max runtime), and to unregister them on turn-off / in Finish, matching Motor.cs.

Why it matters

With the defaults (KickstartPower 255, KickstartDurationMs 100) every activation enters the kickstart branch and drives the output to full power, but KickStartEnd was never scheduled — so the motor/shaker stays pinned at full power instead of dropping to the requested level, and the MaxRunTimeMs safety auto-shutoff never fires. The C# class doc explicitly warns that over-driving a shaker "starts to rattle and shake my cab apart."

Found by diffing against the DirectOutput C# source.

The five AlarmHandler Register/UnregisterAlarm sites in Motor were empty `if (m_alarmHandler != nullptr) {}` stubs. With default settings every activation enters kickstart and drives the output to full power, but KickStartEnd is never scheduled -- so the motor/shaker stays pinned at full power instead of dropping to the requested level, and the MaxRunTimeMs safety shutoff never fires. Wire the Register/UnregisterAlarm calls (and the Finish() unregisters) to match Motor.cs.
@jsm174

jsm174 commented Jul 5, 2026

Copy link
Copy Markdown
Collaborator

Hello. Thanks for the PR!

Converting this to draft as per the contributing rules. (I was behind in getting them added as was just done in Visual Pinball).

It's going to take time to review these. libdof is currently is use by several users with a variety of devices, and we have yet to receive issues about this.

Also this definitely needs thorough testing with the actual hardware.

@jsm174
jsm174 marked this pull request as draft July 5, 2026 18:09
@jsm174
jsm174 marked this pull request as ready for review July 6, 2026 19:33
@jsm174
jsm174 merged commit 69b2c3c into vpinball:master Jul 6, 2026
13 checks passed
@jsm174 jsm174 mentioned this pull request Jul 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants