Skip to content

update to use write_then_readinto for repeated start #3

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 1 commit into from
Aug 19, 2018

Conversation

ladyada
Copy link
Member

@ladyada ladyada commented Aug 18, 2018

tested on m4 &raspi

wait till busdevice version release 2.2.5 to check travis/pr

@ladyada ladyada requested review from kattni and dhalbert August 18, 2018 04:23
@ladyada
Copy link
Member Author

ladyada commented Aug 19, 2018

ok this can now be reviewed!

buf[0] = address & 0xFF
i2c.write(buf, end=1, stop=False)
i2c.readinto(buf, end=count)
i2c.write_then_readinto(bytes([address & 0xFF]), buf,
Copy link
Contributor

Choose a reason for hiding this comment

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

out_end=1 should be specified, I think.

Copy link
Member Author

Choose a reason for hiding this comment

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

we dont have to because i dont use 'buf' anymore, i just create and pass in a single-byte array. oddly when i used buf, it wasnt working. i just did this instead of in-depth investigation on why i couldnt use buf for both output and input

Copy link
Contributor

Choose a reason for hiding this comment

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

got it, i didn't read carefully enough

Copy link
Member Author

Choose a reason for hiding this comment

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

np its confusing, ive mixed both because you write first, then read. anyways...yay!

Copy link
Contributor

@dhalbert dhalbert left a comment

Choose a reason for hiding this comment

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

👍

@dhalbert dhalbert merged commit 4f4db3d into adafruit:master Aug 19, 2018
tannewt pushed a commit to adafruit/Adafruit_CircuitPython_Bundle that referenced this pull request Aug 20, 2018
Updating https://github.com/adafruit/Adafruit_CircuitPython_Fingerp to 1.1.1 from 1.1.0:
  > Merge pull request adafruit/Adafruit_CircuitPython_Fingerp#9 from ladyada/master

Updating https://github.com/adafruit/Adafruit_CircuitPython_FXAS21002C to 1.2.0 from 1.1.0:
  > fix context typo
  > make sure they get a recent version of busdevice with i2c write-then-read support
  > fix wrong reference & pylint
  > use single call for i2c transactions, to support linux

Updating https://github.com/adafruit/Adafruit_CircuitPython_FXOS8700 to 1.2.0 from 1.1.0:
  > Merge pull request adafruit/Adafruit_CircuitPython_FXOS8700#9 from ladyada/master

Updating https://github.com/adafruit/Adafruit_CircuitPython_GPS to 3.1.1 from 3.1.0:
  > Merge pull request adafruit/Adafruit_CircuitPython_GPS#8 from ladyada/master

Updating https://github.com/adafruit/Adafruit_CircuitPython_MMA8451 to 1.2.0 from 1.1.0:
  > Merge pull request adafruit/Adafruit_CircuitPython_MMA8451#3 from ladyada/master

Updating https://github.com/adafruit/Adafruit_CircuitPython_BusDevice to 2.2.5 from 2.2.4:
  > Merge pull request adafruit/Adafruit_CircuitPython_BusDevice#21 from ladyada/master
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