MCUdude / MightyCore

Arduino hardware package for ATmega1284, ATmega644, ATmega324, ATmega324PB, ATmega164, ATmega32, ATmega16 and ATmega8535
Other
649 stars 182 forks source link

ER: Add setWireTimeout to the Wire library #231

Closed mburrack closed 1 year ago

mburrack commented 2 years ago

The main Arduino Wire library has a setWireTimeout method, which is very useful for dealing with unreliable wire connections (which I seem to have on my setup for...reasons?). Regardless, planning for a non-perfect connection in a long-running app is probably wise, which makes setWireTimeout pretty useful.

I've already ported setWireTimeout to the Wire library, but I tried to create a PR for the change and apparently don't have access. I'll see if I can add it to this issue once I submit it...

mburrack commented 2 years ago

Oh, I attach the file to the message, duh, sorry still new to GitHub. src.zip ..

abrahmx commented 2 years ago

Hello! Can you tell me how can I install this updated library that you are providing? Thanks in advance!

MCUdude commented 1 year ago

Wire timeout functionality is now present, but disabled by default.

Modify this file to enable it: https://github.com/MCUdude/MightyCore/blob/master/avr/libraries/Wire/src/Wire_timeout.h

If you're using PlatformIO: https://github.com/MCUdude/MightyCore/blob/master/PlatformIO.md#build_flags