Skip to content
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

Wait for last byte to be sent before continuing #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

pascallj
Copy link

@pascallj pascallj commented Nov 5, 2019

The send_byte function already waits for the USI to become available. So
there is no need to wait in the for loop. However you should wait after all
bytes have been sent to continue safely, as the interrupt makes sure the
timers are given back to the Arduino core.

This example doesn't work right now as the Arduino core tries to delay using
timers still in use by the USI because the interrupt hasn't fired yet.

The send_byte function already waits for the USI to become available. So
there is no need to wait in the for loop. However you should wait after all
bytes have been sent to continue safely, as the interrupt makes sure the
timers are given back to the Arduino core.

This example doesn't work right now as the Arduino core tries to delay using
timers still in use by the USI because the interrupt hasn't fired yet.
@pascallj
Copy link
Author

pascallj commented Nov 5, 2019

But on a side note: great piece of code! It was a big puzzle to me figuring out how it works, but in the end I think this is a very clever and efficient way of using a software serial on the ATtiny.

@dtrzn
Copy link

dtrzn commented Feb 13, 2024

This worked for me @pascallj thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants