diff options
-rw-r--r-- | libraries/Wire/Wire.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/libraries/Wire/Wire.cpp b/libraries/Wire/Wire.cpp index d646132..b08023d 100644 --- a/libraries/Wire/Wire.cpp +++ b/libraries/Wire/Wire.cpp @@ -128,6 +128,7 @@ uint8 TwoWire::process() { // shift out the address we're transmitting to i2c_shift_out(sla_addr); if (!i2c_get_ack()) { + i2c_stop(); // Fix up the state of the bus return ENACKADDR; } // Recieving @@ -146,6 +147,7 @@ uint8 TwoWire::process() { for (uint8 i = 0; i < itc_msg.length; i++) { i2c_shift_out(itc_msg.data[i]); if (!i2c_get_ack()) { + i2c_stop(); // Fix up the state of the bus return ENACKTRNS; } itc_msg.xferred++; |