arduino-CAN
arduino-CAN copied to clipboard
Remove lock up condition in endPacket
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.