mirror of https://github.com/EspoTek/Labrador.git
Reset twoWire on error rather than crash
This commit is contained in:
parent
1d9f2398bb
commit
2158a6f58b
|
@ -131,7 +131,15 @@ void isoDriver::timerTick(void){
|
||||||
{
|
{
|
||||||
if (twoWireStateInvalid)
|
if (twoWireStateInvalid)
|
||||||
twoWire->reset();
|
twoWire->reset();
|
||||||
|
try
|
||||||
|
{
|
||||||
twoWire->run();
|
twoWire->run();
|
||||||
|
}
|
||||||
|
catch(...)
|
||||||
|
{
|
||||||
|
qDebug() << "Resetting I2C";
|
||||||
|
twoWire->reset();
|
||||||
|
}
|
||||||
invalidateTwoWireState = false;
|
invalidateTwoWireState = false;
|
||||||
twoWireStateInvalid = false;
|
twoWireStateInvalid = false;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue