Add start of a SDP service table, which will be linked to the Bluetooth SDP code.
[pub/USBasp.git] / LUFA / Drivers / Peripheral / TWI.c
index eb513c4..9e0c20d 100644 (file)
@@ -17,7 +17,7 @@ bool TWI_StartTransmission(uint8_t SlaveAddress, uint8_t TimeoutMS)
                TWCR = ((1 << TWINT) | (1 << TWSTA) | (1 << TWEN));     \r
 \r
                TimeoutRemaining = (TimeoutMS * 100);\r
-               while (TimeoutRemaining-- && !BusCaptured)\r
+               while (TimeoutRemaining-- && !(BusCaptured))\r
                {\r
                        if (TWCR & (1 << TWINT))\r
                        {\r
@@ -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