-
-
Notifications
You must be signed in to change notification settings - Fork 5.3k
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
I2C Error handling #6689
base: master
Are you sure you want to change the base?
I2C Error handling #6689
Conversation
4488c11
to
4648028
Compare
4648028
to
e36f675
Compare
pins.py code ensure that pins will not mix between HW/SW buses. I2C bus can handle several devices, but we pass it around by pointers, so it does not actually duplicate. Signed-off-by: Timofey Titovets <[email protected]>
I2C Address is the param of a device, not a bus. Done separate addresses from bus implementation. Signed-off-by: Timofey Titovets <[email protected]>
Signed-off-by: Timofey Titovets <[email protected]>
Signed-off-by: Timofey Titovets <[email protected]>
Signed-off-by: Timofey Titovets <[email protected]>
Signed-off-by: Timofey Titovets <[email protected]>
e36f675
to
ec33a81
Compare
I think this is more or less ready to gather feedback, so I will remove the "draft" label. |
Thank you for your contribution to Klipper. Unfortunately, a reviewer has not assigned themselves to this GitHub Pull Request. All Pull Requests are reviewed before merging, and a reviewer will need to volunteer. Further information is available at: https://www.klipper3d.org/CONTRIBUTING.html There are some steps that you can take now:
Unfortunately, if a reviewer does not assign themselves to this GitHub Pull Request then it will be automatically closed. If this happens, then it is a good idea to move further discussion to the Klipper Discourse server. Reviewers can reach out on that forum to let you know if they are interested and when they are available. Best regards, PS: I'm just an automated script, not a human being. |
As mentioned: #6674 (comment)
That would be nice to handle I2C errors, instead of the current shutdown approach.
There is a refactoring part to make things more obvious, where is the dev and where is the bus.
Errors handling works, but:
There should be a better way to define & pass errors to Klippy. I think it would be possible to reuse static_stings_id for that.When klippy inits and I2C returns an error, it is an unhandled exception, so it only appears in logs. There should be a fix actually to show it to frontends as before with shutdown msg.Missing handling forldc1612 - used in homing sequence, there is no reason or way to handle errors.So, they stop updating data, if there is no heater for them, the machine will continue running.
About the code itself:
(I still somewhat think about non-blocking i2c, it feels right to store queue/buf at bus level),
int ret
looks a little dirty to me, maybe it is a bad approach here, I will be glad to receive any feedback.(maybe with timers there is a simple way with callbacks, cause we don't need to do something with stack).
Thanks.