Hi guys,
I’m new in town, so please be gentle.
I have searched around web to solve this issue but had no luck.
Known problem is that Arduino Wire library can hang if SCL or SDA line is held low by any reason.
By reading forums I have found WSWire library may be solution but I do not know how to include it since I get conflict when I try to include WSWire.h instead of Wire.h in my code.
Even simple code like this fail to compile.
#include <WSWire.h> //https://github.com/steamfire/WSWireLib
void setup() {
Wire.begin();
}
void loop() {
while(1);
}
I am getting a bunch of messages…
libraries\Wire\Wire.cpp.o (symbol from plugin): In function `TwoWire::available()’:
(.text+0x0): multiple definition of `TwoWire::available()’
libraries\WSWireLib-master\WSWire.cpp.o (symbol from plugin):(.text+0x0): first defined here
.
.
.libraries\WSWireLib-master\utility\twi.c.o (symbol from plugin):(.text+0x0): first defined here
libraries\Wire\utility\twi.c.o (symbol from plugin): In function `twi_readFrom’:
(.text+0x0): multiple definition of `twi_releaseBus’
libraries\WSWireLib-master\utility\twi.c.o (symbol from plugin):(.text+0x0): first defined here
libraries\Wire\utility\twi.c.o (symbol from plugin): In function `twi_readFrom’:
(.text+0x0): multiple definition of `__vector_24’
libraries\WSWireLib-master\utility\twi.c.o (symbol from plugin):(.text+0x0): first defined here
collect2.exe: error: ld returned 1 exit status
exit status 1
Error compiling for board Arduino Pro or Pro Mini.
I have cut off rest off messages since it’s all similar.
Why I can not include WSWireLib in my project and is there any better solution to fix Wire hang problem_
I know it is possible to modify twi.h file to add timeout function but I do not like to modify standard library.
I am using last relase Arduino IDE 1.8.5.
Sorry for my poor English. It’s not my native language.
Best regards.