Remove lock up condition in endPacket #160
Open
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.
I see there are a few mentions of this condition and some pull requests to fix.
If the is a problem with the CAN transceiver (or there isn't one) this library basically locks up the whole ESP32.
I have changed the TX buffer check to a single check. If the buffer is full the function should return with a negative response and let the user program figure out what to do. There is no guarantee the buffer will become available so it shouldn't wait forever.
I also removed the check to wait for TX completion. I don't see the need to wait for the TX to complete before returning. This only leads to a lock up.
I think it would be good to implement this or something similar. Will save a lot of debug frustration in using what is otherwise a great library.