Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

fix(SoftwareSerial): correct TX to RX switch when using half-duplex#1771

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
fpistm merged 1 commit intostm32duino:mainfromdominikberse:sw_serial_half_duplex
Jul 29, 2022

Conversation

dominikberse
Copy link
Contributor

Summary

When working with single-pin half-duplex SoftwareSerial, I noticed that after the call tolisten() receiving data is not possible until data is written. In factsetRXTX(true) is only called withinsend(), which in turn is only called as long asactive_out is set (i.e. ongoing transmission). Since at the beginning oflisten() completion of any ongoing transmissions is awaited, the SoftwareSerial will not actively listen before another transmission is completed.

This PR fixes/implements the followingbugs/features

  • Fixes the above behavior
  • No intentional breaking changes

This occurs if the communication is not initiated by the STM32. Otherwise, one would simply calllisten() and then send whatever will trigger the other side to respond.

In my case, I wanted to use a second line to indicate the direction of communication (which however can not be used as a second line for full-duplex). I must admit that this is probably a very rare case, and the fix I suggest will in fact change the current behavior of callinglisten() before sending data. However it took me a few hours to debug this and I thought I should at least mention this finding in case someone else stumbles upon it.

Copy link
Member

@fpistmfpistm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

LGTM

Copy link
Contributor

@ABOSTMABOSTM left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

@dominikberse
thanks for sharing your findings.
Patch LGTM

@fpistmfpistm merged commite773fec intostm32duino:mainJul 29, 2022
julien33510 added a commit to julien33510/arduino_essai1 that referenced this pull requestOct 2, 2023
mise en place de la librairie semi-duplex trouvé sur github (stm32duino/Arduino_Core_STM32#1771) et ajout de la spécificité pour les bits de parité et les 2 bits stop=> succès
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@fpistmfpistmfpistm approved these changes

@ABOSTMABOSTMABOSTM approved these changes

Assignees
No one assigned
Labels
enhancementNew feature or request
Projects
None yet
Milestone
2.4.0
Development

Successfully merging this pull request may close these issues.

3 participants
@dominikberse@fpistm@ABOSTM

[8]ページ先頭

©2009-2025 Movatter.jp