-
-
Notifications
You must be signed in to change notification settings - Fork 7k
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
Bug in SoftwareSerial when using inverse logic #2090
Conversation
@@ -355,7 +355,7 @@ SoftwareSerial::~SoftwareSerial() | |||
void SoftwareSerial::setTX(uint8_t tx) | |||
{ | |||
pinMode(tx, OUTPUT); | |||
digitalWrite(tx, HIGH); | |||
digitalWrite(tx, _inverse_logic ? LOW : HIGH); |
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.
Do not set the start bit when using inverse logic, preventing the receiving end to think the transmission started when was not intentionally started.
Hmm, I could have sworn I saw a pulrequest for this change before, but I can't find it right now. In any case, the change looks good to me. However, I think the commit message needs to be improved before this can be merged - it contains no information whatsover except the bug number. The commit messages should be self-contained and explain what happens and why, and additionally reference the bug report (but that's secondary). E.g., something like:
|
Oh right, the PR I saw before was your other one, of course. Never mind that part of my comment :-) |
As far as I can tell, it's not possible to change a commit message, when first pushed. Any help in the right direction will be helpful... |
You can! :-) Locally, you can change the commit message of the most recent commit using To push out the changed commit to github, use |
Previously, when SoftwareSerial was initialized, it would always be set to an idle level of HIGH, even when inverted logic was enabled. Once a byte is transmitted, the idle level gets correctly set to LOW instead. This commit makes sure that the idle level is correct directly after initialization already. This fixes arduino#1361.
Done :) |
Looking good! |
Bug in SoftwareSerial when using inverse logic
Thanks! |
Fix for reported bug #1361
For more further description of the bug, see http://forum.arduino.cc/index.php?topic=159726