-
Notifications
You must be signed in to change notification settings - Fork 16
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
UART fixes #10
UART fixes #10
Conversation
I tryied to implement your change on the current state of the repo, where files for uart and i2c are split. So that is everything you have between That first attempt fail on
I tried changing to
But that fail with this error message a few steps later:
Right now I have the following feeling:
I am not sure about everything, and obviously my attempt at using your code failed. |
Also notice that I have a PR pending #12 with the improvement that @Gadgetoid from Pimoroni did on a previous version/branch/fork. It is only in init and uart, so it should not stop you from doing an uart_active.py |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did not do any testing, but David's comments seem to indicate that this does not work on CircuitPython as written.
My brain's been stuck in Java/SQL mode for weeks thanks to dayjob stuff but during the long weekend I'm planning to shift gears back to CircuitPython to take a fresh look at this. At the very least I'll need to apply the changes to the newer structure with UART and I2C in separate files, based on David's commentary above. Also, I've got some MagTags, QT Pys, and a few other random MCUs on hand that should provide a solid platform for testing this outside of the RPi world where I did the initial work. |
Given that the structure has changed since this PR was made, I'm going to close it and open another once my development is complete. Thanks for the comments, @dglaude and @jepler! I'll make sure that the next PR is fully tested on MCUs running CircuitPython instead of just testing with a full Python environment on a RPi. 😂 |
PM25_UART
initPM25_UART_PASSIVE
class with an init and_read_into_buffer()
's
_read_into_buffer()` to retry in cases where the device wasn't ready after a mode change or the uart still had an 8-byte mode change response waitinguart.read()
after mode change in each init to make sure that the change worked as expected and that the mode change bytes are removed from the buffer before any future readsTested with a PM5003 on a RPi with an Enviro+ hat
Fixes issue #9