Open the display serial port in exclusive mode - #1096
Open
d-tatianin wants to merge 1 commit into
Open
d-tatianin wants to merge 1 commit into
d-tatianin wants to merge 1 commit into
Conversation
Nothing prevented two instances of the system monitor from opening the same serial port, e.g. when using "Save and run" from the configuration window while the system monitor is already running. Both instances then send commands to the display at the same time: the interleaved data corrupts the display (torn images), and a Turing 3.5" (rev. A) ends up rebooting and disconnecting from USB again and again. Open the port with pyserial exclusive=True. On Linux and macOS, it takes a flock() on the port so that a second instance cannot open it: it fails through the existing retry logic instead of corrupting the display. On Windows the option is ignored, COM ports are already opened in exclusive mode by the OS.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.