diff options
author | Dean Camera <dean@fourwalledcubicle.com> | 2011-12-23 01:51:39 +0000 |
---|---|---|
committer | Dean Camera <dean@fourwalledcubicle.com> | 2011-12-23 01:51:39 +0000 |
commit | f201f6697b7f99b63389509b42112026b8f6f76f (patch) | |
tree | 9f38b5271f3a5ff10083f4f3e27598ced92efe11 /LUFA/Drivers/Peripheral/AVR8/TWI_AVR8.c | |
parent | 77f354609f0411fb6541da31a889186ad402838e (diff) | |
download | lufa-f201f6697b7f99b63389509b42112026b8f6f76f.tar.gz lufa-f201f6697b7f99b63389509b42112026b8f6f76f.tar.bz2 lufa-f201f6697b7f99b63389509b42112026b8f6f76f.zip |
Run wspurify script on /trunk/ and /branches/ C source files, to remove any trailing whitespace at the end of each line.
Diffstat (limited to 'LUFA/Drivers/Peripheral/AVR8/TWI_AVR8.c')
-rw-r--r-- | LUFA/Drivers/Peripheral/AVR8/TWI_AVR8.c | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/LUFA/Drivers/Peripheral/AVR8/TWI_AVR8.c b/LUFA/Drivers/Peripheral/AVR8/TWI_AVR8.c index d6db37d6e..b77aa0822 100644 --- a/LUFA/Drivers/Peripheral/AVR8/TWI_AVR8.c +++ b/LUFA/Drivers/Peripheral/AVR8/TWI_AVR8.c @@ -119,9 +119,9 @@ bool TWI_ReceiveByte(uint8_t* const Byte, TWCR = TWCRMask; while (!(TWCR & (1 << TWINT))); *Byte = TWDR; - + uint8_t Status = (TWSR & TW_STATUS_MASK); - + return ((LastByte) ? (Status == TW_MR_DATA_NACK) : (Status == TW_MR_DATA_ACK)); } @@ -133,19 +133,19 @@ uint8_t TWI_ReadPacket(const uint8_t SlaveAddress, uint8_t Length) { uint8_t ErrorCode; - + if ((ErrorCode = TWI_StartTransmission((SlaveAddress & TWI_DEVICE_ADDRESS_MASK) | TWI_ADDRESS_WRITE, TimeoutMS)) == TWI_ERROR_NoError) { while (InternalAddressLen--) { if (!(TWI_SendByte(*(InternalAddress++)))) - { + { ErrorCode = TWI_ERROR_SlaveNAK; break; } } - + if ((ErrorCode = TWI_StartTransmission((SlaveAddress & TWI_DEVICE_ADDRESS_MASK) | TWI_ADDRESS_READ, TimeoutMS)) == TWI_ERROR_NoError) { @@ -157,11 +157,11 @@ uint8_t TWI_ReadPacket(const uint8_t SlaveAddress, break; } } - + TWI_StopTransmission(); } } - + return ErrorCode; } @@ -180,7 +180,7 @@ uint8_t TWI_WritePacket(const uint8_t SlaveAddress, while (InternalAddressLen--) { if (!(TWI_SendByte(*(InternalAddress++)))) - { + { ErrorCode = TWI_ERROR_SlaveNAK; break; } @@ -194,9 +194,10 @@ uint8_t TWI_WritePacket(const uint8_t SlaveAddress, break; } } - + TWI_StopTransmission(); } - + return ErrorCode; } + |