Fix TWI driver not aborting when faced with no response after attempting to address...
authorDean Camera <dean@fourwalledcubicle.com>
Thu, 25 Feb 2010 02:47:42 +0000 (02:47 +0000)
committerDean Camera <dean@fourwalledcubicle.com>
Thu, 25 Feb 2010 02:47:42 +0000 (02:47 +0000)
LUFA/Drivers/Peripheral/TWI.c
LUFA/ManPages/ChangeLog.txt

index eb513c4..7986679 100644 (file)
@@ -66,8 +66,8 @@ bool TWI_StartTransmission(uint8_t SlaveAddress, uint8_t TimeoutMS)
                        case TW_MR_SLA_ACK:\r
                                return true;\r
                        default:\r
-                               TWI_StopTransmission();\r
-                               break;\r
+                               TWCR = ((1 << TWINT) | (1 << TWSTO) | (1 << TWEN));\r
+                               return false;\r
                }\r
        }\r
 }\r
index 155afa0..0ef0fbc 100644 (file)
@@ -20,6 +20,7 @@
   *  <b>Fixed:</b>\r
   *  - Fixed software PDI/TPI programming mode in the AVRISP project not correctly toggling just the clock pin\r
   *  - Fixed TWI_StartTransmission() corrupting the contents of the GPIOR0 register\r
+  *  - Fix TWI driver not aborting when faced with no response after attempting to address a device on the bus\r
   *\r
   *  \section Sec_ChangeLog100219 Version 100219\r
   *\r