Skip to content

add write_then_readinto support for linux (and possibly others!) #20

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

Merged
merged 3 commits into from
Aug 17, 2018

Conversation

ladyada
Copy link
Member

@ladyada ladyada commented Aug 17, 2018

we do a fallback if there's no inherent busio support for single-transaction write+read, so should continue to work fine under current micros

@ladyada ladyada requested a review from tannewt August 17, 2018 17:42
Copy link
Member

@tannewt tannewt left a comment

Choose a reason for hiding this comment

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

One thing and then feel free to commit. Thanks!

@@ -101,6 +101,44 @@ def write(self, buf, **kwargs):
"""
self.i2c.writeto(self.device_address, buf, **kwargs)

#pylint: disable-msg=too-many-arguments
def write_then_readinto(self, out_buffer, in_buffer,
Copy link
Member

Choose a reason for hiding this comment

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

Add a *, after in_buffer, to make the remaining arguments kwarg-only. This way the start and stop numbers must always be "labeled".

@ladyada ladyada merged commit 76bce0d into adafruit:master Aug 17, 2018
tannewt pushed a commit to adafruit/Adafruit_CircuitPython_Bundle that referenced this pull request Aug 18, 2018
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