8000 Addition of RTS/CTS/RS485 capability by mubes · Pull Request #2629 · adafruit/circuitpython · GitHub
[go: up one dir, main page]

Skip to content

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

Merged
merged 6 commits into from
Feb 19, 2020
Merged

Conversation

mubes
Copy link
@mubes mubes commented Feb 16, 2020

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.

@mubes
Copy link
Author
mubes commented Feb 18, 2020

RS485 now incorporated and tested.

@tannewt tannewt self-requested a review February 18, 2020 21:45
@tannewt tannewt added circuitpython api enhancement mimxrt10xx iMX RT based boards such as Teensy 4.x labels Feb 18, 2020
@tannewt tannewt added this to the 5.x.0 - Features milestone Feb 18, 2020
Copy link
Member
@tannewt tannewt left a 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.

Copy link
Collaborator
@arturo182 arturo182 left a 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?

@tannewt
Copy link
Member
tannewt commented Feb 18, 2020

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.

@mubes
Copy link
Author
mubes commented Feb 19, 2020

OK, that should be all the review comments addressed and merge issues addressed. Hopefully ready for shipping.

@arturo182
Copy link
Collaborator

(Code review comments on formatting also distract from deeper level review too.)

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

@arturo182
Copy link
Collaborator

Looks good! @mubes please run make translate and add the .po files to the PR.

@mubes
Copy link
Author
mubes commented Feb 19, 2020

(Code review comments on formatting also distract from deeper level review too.)

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

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.

Copy link
Member
@tannewt tannewt left a 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!

@tannewt tannewt merged commit 4552aff into adafruit:master Feb 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
circuitpython api enhancement mimxrt10xx iMX RT based boards such as Teensy 4.x
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
0