-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Addition of RTS/CTS/RS485 capability #2629
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
Conversation
RS485 now incorporated and tested. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall this looks really good! It'll need to be updated that #2618 is merged.
As a heads up, as @arturo182 pointed out in the other PR, your code formatting doesn't match our typical format. I try not to nitpick format in reviews but we will be enabling a format check soon. (Once micropython#4223 is settled.) So, beware that your code will need to be reformatted before merge in the future.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not as strong as @tannewt so I nitpick a bit about the formatting. Other than that, everything looks good! Were the pin fixes that you made in the 1011 and 1062 wrong originally?
Please be careful who you nitpick about formatting. It can deter some folks from contributing more and isn't worth the risk if we can automate that away anyway. (Code review comments on formatting also distract from deeper level review too.) In this case, I think @mubes is happy to match whatever style we choose. |
OK, that should be all the review comments addressed and merge issues addressed. Hopefully ready for shipping. |
Yes, I've seen that happen quite a few times in some projects. My way for dealing with that is to make 2 passes at the code, first one is the obvious formatting issues and then I take a second pass looking only at the functionality of the code and comment on that. Yes I understand we don't want to scare people off with comments about formatting but we also want to have nice code :D |
Looks good! @mubes please run |
That was the idea behind putting the files up a few days back before they were fully cooked. I have no problem making coding style changes (e.g. ==true tests) because consistency there really helps code understanding but format and layout things should be dealt with by a tool, even if the results are less than perfect layout-wise. Personally, I don't want to be wasting highly qualified and skilled people on making sure their brackets are on the right line. That is important for clear and consistent understanding of the code, but it can, and should, be done by machine. We need to get a formatter up and integrated ASAP...then the comments only need to address the substantive code style issues. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me too! Thanks!
These patches implement RTS/CTS and RS485 handling for UART by means of adding optional rts, cts, rs485_dir and rs485_invert options to the Python UART constructor. Implementation is complete and compiles for all IMXRT range and was tested on IMXRT1021. For other CPUs it will compile but will throw an exception if any attempt is made to use the new features, until they're added in the underlying driver.
It also addresses a few bugs in the IMXRT UART handler.