Cycle CS pin in case of checksum error #4
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.
With this PR, I’m adding a line which disables the CS pin in case of a checksum error.
Sometimes it happens that a slave gets in a state which never exits a loop of checksum errors, and a chip select cycle is needed.
With this fix, my firmware never gets stuck in that kind of loop. I don’t know whether this solution applies universally, so I’d like to have my change reviewed, as I am still relatively new to this BMS chip (LTC6813).
I also don’t know if state changes of the CS pin should happen in this function, as callers might not expect this.