fix(cdc/ftdi): correct divisor selection in 1 MBaud to 2 MBaud range (IEC-534)#488
Open
spectrumjade wants to merge 1 commit intoespressif:masterfrom
Open
fix(cdc/ftdi): correct divisor selection in 1 MBaud to 2 MBaud range (IEC-534)#488spectrumjade wants to merge 1 commit intoespressif:masterfrom
spectrumjade wants to merge 1 commit intoespressif:masterfrom
Conversation
Collaborator
|
@spectrumjade thank you for the contribution! I'll have to check why we did not enable 1.5Mbit. IIRC, the chips that I tested with did not support this baudrate. I'll double check so we can merge this PR, thanks! |
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.
fix(cdc/ftdi): correct divisor selection in 1 MBaud to 2 MBaud range
Description
Previously, baud rates between above 1 MBaud were short-circuited to a special case divisor (either 0 or 1), but had the wrong reported realized rate. In the case of
baudrate >= 1000000, the selected divisor was 1, which programs the chip at 2 MBaud (per AN232B-05), not 1 MBaud as claimed in the comment and set asbaudrate_real. In addition, rates that the general divisor path could have handled (notably including 1.5 MBaud, which uses even divisor of 2) were being silently coerced to 2 MBaud.This PR corrects the two special case divisors and allows baud rates below 2 MBaud to be handled by the general divisor path. This allows 1.5 MBaud to work properly.
Testing
Confirmed that an FT232R, which previously was not successfully able to function at a requested 1.5 MBaud, is now working properly at 1.5 MBaud.
Checklist
Before submitting a Pull Request, please ensure the following: