Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FAST Retro Platform: System11 Support #1769

Merged
merged 27 commits into from
Mar 1, 2024

Conversation

avanwinkle
Copy link
Collaborator

This PR migrates the System11 Retro Platform code to MPF 0.57 and the new FAST interface protocols. It also includes a number of stability improvements, bug fixes, and logging quality of life updates.

System11 Retro

Special Driver Type

The bulk of this PR is to support the System11 A/C Relay driver, which is now supported in the FAST Retro firmware with the special driver mode 25. It adds numerous special commands to configure, enable, and disable the A/C relay.

Virtual Relay Switch

Support is also added for a "virtual switch" to represent the open/closed state of the relay. For machines that don't include a physical switch, the FAST Retro platform will emulate a switch which can then be used by MPF to confirm when the relay has completed its state change. The fallback behavior of a timeout still exists.

Queue bypassing and side prioritization

This PR refactors the implementation of a "preferred" side of the relay, to allow high-priority drivers (e.g. coils) to take precedence over drivers on the preferred side (e.g. flashers). Typically the System11 interface will wait for the preferred side queue to be clear before switching, but flasher shows can clog up the queue and prevent the coils from ever being fired. With this PR, additional calls to the preferred queue can be ignored when the other side is requested, ensuring that coil actions happen immediately.

Other Improvements

Bugfix autodetect logic

This PR improves the logic for looping over serial devices during port auto detection. There were gaps in the previous logic that could lead to infinite loops or uncancelled tasks, both of which would prevent game startup if a FAST connection (even an optional one) was not found.

Assert required responses from FAST NET

This PR adds an assert statement (in dev mode only) to ensure that any FAST NET command that holds the queue for a response has a required response of at least 3 characters. The logic to validate responses is based on the message header, which is three characters, so any blocker for less than 3 characters will never fulfill and all communications with the NET will stop. The assert statement will help to prevent these situations.

Log serial writer exceptions

This PR adds an error log when an exception is caught by the serial writer, before that exception is swallowed. It's okay to swallow exceptions, but without a log there is no way to know an issue exists and could silently break communication with the NET platform. The new error log will help developers troubleshoot NET communication issues without pulling out their hair (ask me how I know!).

it's a relay!

…s-machine-vars-persist

Fix tests from missionpinball#1708 machine variable persistence
# Conflicts:
#	mpf/devices/ball_device/outgoing_balls_handler.py
#	mpf/devices/multiball_lock.py
#	mpf/modes/bonus/code/bonus.py
#	mpf/platforms/fast/fast.py
#	mpf/platforms/fast/fast_driver.py
Copy link

sonarcloud bot commented Mar 1, 2024

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

@avanwinkle avanwinkle merged commit b8a717a into missionpinball:dev Mar 1, 2024
14 checks passed
@avanwinkle avanwinkle deleted the pt-sov-dev branch March 1, 2024 23:52
@avanwinkle avanwinkle restored the pt-sov-dev branch March 1, 2024 23:52
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.

1 participant