Improve error handling for TPS546 i2c communications #427
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
My compiler complained about unused variables in the variables used in the read functions. When I tried to fix it, I noticed on a lot of places there is no error handling, so I tried to improve it a bit. My assumption is that the i2c communications shouldn't fail halfway, and if it fails, something is wrong. With this change it'll abort operations.
I'm not 100% sure if this is correct and I don't have a BitAxe with a TPS546, so this is a bit of a stab in the dark. It is more in line with how the error handling for other i2c components are done.
Write functions have the same issue, where the
esp_err_t
return value is not checked, even with multiple sequential writes. I assume this needs to have the same treatment?