-
Notifications
You must be signed in to change notification settings - Fork 13.7k
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
ina238: retry if read fails #24163
ina238: retry if read fails #24163
Conversation
8da3c6d
to
c90e87e
Compare
|
||
if (ret == PX4_OK) { | ||
data = swap16(received_bytes); | ||
for (size_t i = 0; i < 6; i++) { |
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.
Why not use the actual _retries mechanism in I2C?
PX4-Autopilot/src/lib/drivers/device/nuttx/I2C.cpp
Lines 229 to 235 in e3b98e6
if ((_retries > 0) && (retry_count < _retries)) { | |
#if defined(CONFIG_I2C_RESET) | |
DEVICE_DEBUG("I2C bus: %d, Addr: %X, I2C_RESET %d/%d", | |
get_device_bus(), get_device_address(), retry_count + 1, _retries); | |
I2C_RESET(_dev); | |
#endif // CONFIG_I2C_RESET | |
} |
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.
Updated and pushed.
c90e87e
to
4a81e65
Compare
Noticing some occasional dropouts of the data with the ARK 12s power modules. Same thing I found on the INA226 a couple of years ago. A single bad I2C read would cause the driver to publish 0's and not connected.
#19423
Needs to be tested on hardware.
Current behavior