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
from

Conversation

@pascallj
Copy link

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

This comment has been minimized.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant
You can’t perform that action at this time.