h2zero / n-able-Arduino

An arduino core for ARM based BLE devices supported by the NimBLE stack.
GNU Lesser General Public License v2.1
36 stars 15 forks source link

The Wire Library Sometimes Causes Code to Hang #56

Closed timnicolas closed 2 weeks ago

timnicolas commented 3 months ago

In some situations, the implementation of the Wire library causes the code to hang. I can't pinpoint the exact situations, but it occurs for me when I'm using BLE and running code that executes quite quickly (with very few delay statements).

I propose this implementation that allows I2C transmissions to fail gracefully when they get stuck.

h2zero commented 1 month ago

Sorry I totally forgot to get back to this. Looks good but I'd be really interested to find the actual cause, communication error?

Regardless, it makes sense to eliminate the possibility of and endless loop.

timnicolas commented 4 weeks ago

Hi! Thanks for the follow-up. I haven’t pinpointed the exact cause, but since implementing this code, I haven’t encountered any more issues.