Skip to content

a little refactoring, speed-up, and CPython compatibility #5

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 5 commits into from
Aug 21, 2018

Conversation

ladyada
Copy link
Member

@ladyada ladyada commented Aug 20, 2018

added: auto-detect baudrate, allow baudrate change, no flush during read_picture_into (yay faster), CPython compatible with example

removed: initialization args have been change, only pass in a uart now!

tested on feather m4 w/wing and internal FS

API changed so we'll need a large version bump. but it was terribly slow before

…ead_picture_into (yay faster), CPython compatible with example

removed: initialization args have been change, only pass in a uart now!
@ladyada ladyada requested review from tannewt and kattni August 20, 2018 05:48
@ladyada
Copy link
Member Author

ladyada commented Aug 20, 2018

passing travis & ready for review!

Copy link
Contributor

@kattni kattni left a comment

Choose a reason for hiding this comment

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

Looks good to me!

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.

A couple small things. Good overall. Thanks!

for _ in range(2): # 2 retries to reset then check resetted baudrate
for baud in (9600, 19200, 38400, 57600, 115200):
self._uart.baudrate = baud
if self._run_command(_RESET, bytes([0x00]), 5):
Copy link
Member

Choose a reason for hiding this comment

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

Instead of bytes([0x00]) do b'\x00'. That way it doesn't need to create a list to convert to bytes.

:param ~microcontroller.Pin tx: Transmit pin
:param int baudrate: Serial connection speed
:param int timeout: Read timeout in seconds
:param int buffer_size: Receive buffer size
Copy link
Member

Choose a reason for hiding this comment

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

I'd suggest updating this, not just deleting it. It makes for nicely formatted docs: https://circuitpython.readthedocs.io/projects/vc0706/en/latest/api.html#adafruit_vc0706.VC0706

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.

Looks good!

@ladyada ladyada merged commit 990dcd0 into adafruit:master Aug 21, 2018
tannewt pushed a commit to adafruit/Adafruit_CircuitPython_Bundle that referenced this pull request Aug 21, 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.

3 participants