X-Git-Url: http://git.linex4red.de/pub/USBasp.git/blobdiff_plain/c0c982df7af34ea0375eda774185f3825c261522..d03d6513d0d24cf63225c8d3dfa07675d9107f40:/LUFA/Drivers/Peripheral/TWI.c?ds=inline diff --git a/LUFA/Drivers/Peripheral/TWI.c b/LUFA/Drivers/Peripheral/TWI.c index eb513c454..9e0c20dc0 100644 --- a/LUFA/Drivers/Peripheral/TWI.c +++ b/LUFA/Drivers/Peripheral/TWI.c @@ -17,7 +17,7 @@ bool TWI_StartTransmission(uint8_t SlaveAddress, uint8_t TimeoutMS) TWCR = ((1 << TWINT) | (1 << TWSTA) | (1 << TWEN)); TimeoutRemaining = (TimeoutMS * 100); - while (TimeoutRemaining-- && !BusCaptured) + while (TimeoutRemaining-- && !(BusCaptured)) { if (TWCR & (1 << TWINT)) { @@ -66,8 +66,8 @@ bool TWI_StartTransmission(uint8_t SlaveAddress, uint8_t TimeoutMS) case TW_MR_SLA_ACK: return true; default: - TWI_StopTransmission(); - break; + TWCR = ((1 << TWINT) | (1 << TWSTO) | (1 << TWEN)); + return false; } } }