Closed tomaszduda23 closed 3 years ago
assert != crash, it is just checking for fatal condition, like in your case because hardware was miss-configured correctly #8 . It will also disappear if user will set NDEBUG define during build, so i think for future purpose we need some better solution if you want try to check hardware during runtime.
The problem is that CAN Init fail (pcan_can_init_ex) is not handled in any way. There are several ways that it could be done:
If CAN Init fails HAL_CAN_ActivateNotification is never called again which seems to be a bug. Anyway there is a several ways to solve it. assert was just simple enough and worked perfect for me.
it will happens only if your hardware is connected wrong way, I'm sorry but i really don't like such solution. I do not want to tell that current solution is OK, but we need something better.
I agree that it is bad solution. It was just good enough for the problem which I had. Maybe you can consider this as "improvement request". It would be nice if HW misconfiguration is handled somehow. I guess I'm not going to be only one who run into this problem.
Otherwise it crashes later on during port open.