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

fix: 🐛 Wait for serial port to be properly configured by VEXos #749

Open
wants to merge 1 commit into
base: develop-pros-4
Choose a base branch
from

Conversation

ion098
Copy link
Contributor

@ion098 ion098 commented Feb 4, 2025

Summary:

This PR changes all serial functions to wait for VEXos to configure the smart port as generic serial.

Motivation:

VEXos takes some time to configure a smart port as generic serial, which can lead to the serial API mysteriously failing when called too soon after serial_enable.

Test Plan:

  • test it compiles
  • test that serial data can be sent immediately after calling serial_enable

@aghangurde
Copy link
Contributor

How did you come to the 500ms figure? And what motivates specifically 5 100ms intervals?

@ion098
Copy link
Contributor Author

ion098 commented Feb 4, 2025

re @aghangurde

How did you come to the 500ms figure? And what motivates specifically 5 100ms intervals?

According to the testing done by vexide here, generic serial generally takes 10ms to configure. I chose 500ms to provide a safety margin (The extra 490ms shouldn't matter too much since the delay should only ever happen once). Also, the code does 100 5ms intervals, not vice versa (most of the devices code that delays for some reason use 5ms as the delay time, so I used it as well).

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