Fix 'requestFrom' rollback issue and add a little more bullet proofing #50
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Added 'busy' flag to enable slave time to finish processing previous request.
Moved the setting of SDA as input to SET_USI_TO_TWI_START_CONDITION_MODE. This
helps to prevent conditions where SDA is held low indefinitely after a
SET_USI_TO_SEND_ACK or SET_USI_TO_SEND_DATA, due to a missed clock pulse.
Added macro SET_USI_TO_TWI_OVERFLOW_MODE.
Added a timeout to wait for proper start condition latch. Helps with second
point above.
Added function usiTwiHandleSTOP which is called when a stop condition is
detected via TinyWireS_stop_check. This ensures use of new 'busy' flag.
TinyWireS_stop_check modified to use usiTwiHandleSTOP.
Reinstated multibyte 'requestFrom' by master functionality.
Added tws_delay_micros function.
Added a few more comments and reduced some confusion resulting from mixing up
the roles of 'Master read' and 'Master write' with what the slave is doing.
I think that one actually came from the app note and original source!
Tested with ATtiny85 (1MHz) and SAMD21 (48MHz) as master.
Fixes issue Surprise, as of f0eb04f the communication doesn't work anymore, only 255 response #44 . Potentially helps with issues Feature Suggestion #24 , Requesting multiple bytes: the correct way #36 , Request Callback is not triggered #43 and Read only gives 0xFF on Attiny85 #47 ?