-
Notifications
You must be signed in to change notification settings - Fork 79
fix: 🐛 Wait for serial port to be properly configured by VEXos #749
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
base: develop-pros-4
Are you sure you want to change the base?
Conversation
|
How did you come to the 500ms figure? And what motivates specifically 5 100ms intervals? |
|
re @aghangurde
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). |
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
@ion098 what is the reason why you add the delay on |
|
re @AndrewLuGit
Delaying in |
|
@ion098 you are right, calling |
|
@AndrewLuGit I think the best solution here would be to make the |
|
I have modified |
|
re @AndrewLuGit
From the testing done by the vexide folks, it seems like the delay is dependent on previous program runs: if the port was configured as a serial port in a previous program run, there will be little or no delay in future runs. I would try testing it with a power cycle between each program run. |
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:
serial_enable