aboutsummaryrefslogtreecommitdiff
path: root/LUFA/Drivers/Peripheral/AVR8
diff options
context:
space:
mode:
authorDean <Dean@d5102386-fcda-11dd-9fdb-3debd5008f28>2011-08-22 13:03:56 +0000
committerDean <Dean@d5102386-fcda-11dd-9fdb-3debd5008f28>2011-08-22 13:03:56 +0000
commitd4e308572cd882cfba75a9b8ab367eab80e3005c (patch)
tree43b71715d52e266156428023db2b83b81cf3f540 /LUFA/Drivers/Peripheral/AVR8
parenta89f2b43f5a97a98d0104a61f85fe8ca8d02d988 (diff)
Renamed the JTAG_DEBUG_ASSERT() macro to JTAG_ASSERT().
Changed the reports in the GenericHID device demos to control the board LEDs, to reduce user confusion over the callback routines. Fixed swapped TWI_ADDRESS_READ and TWI_ADDRESS_WRITE values. Fixed TWI_ReadPacket() not releasing the TWI bus on read completion. git-svn-id: http://lufa-lib.googlecode.com/svn/trunk@1911 d5102386-fcda-11dd-9fdb-3debd5008f28
Diffstat (limited to 'LUFA/Drivers/Peripheral/AVR8')
-rw-r--r--LUFA/Drivers/Peripheral/AVR8/TWI_AVR8.c2
-rw-r--r--LUFA/Drivers/Peripheral/AVR8/TWI_AVR8.h4
2 files changed, 3 insertions, 3 deletions
diff --git a/LUFA/Drivers/Peripheral/AVR8/TWI_AVR8.c b/LUFA/Drivers/Peripheral/AVR8/TWI_AVR8.c
index 2f65921c..d4f594f3 100644
--- a/LUFA/Drivers/Peripheral/AVR8/TWI_AVR8.c
+++ b/LUFA/Drivers/Peripheral/AVR8/TWI_AVR8.c
@@ -117,7 +117,7 @@ uint8_t TWI_ReadPacket(const uint8_t SlaveAddress,
{
while (Length--)
{
- if (!(TWI_ReceiveByte(Buffer++, (Length == 0))))
+ if (!(TWI_ReceiveByte(Buffer++, (Length == 1))))
{
ErrorCode = TWI_ERROR_SlaveNAK;
break;
diff --git a/LUFA/Drivers/Peripheral/AVR8/TWI_AVR8.h b/LUFA/Drivers/Peripheral/AVR8/TWI_AVR8.h
index c35499ef..63b9f03c 100644
--- a/LUFA/Drivers/Peripheral/AVR8/TWI_AVR8.h
+++ b/LUFA/Drivers/Peripheral/AVR8/TWI_AVR8.h
@@ -143,12 +143,12 @@
/** TWI slave device address mask for a read session. Mask with a slave device base address to obtain
* the correct TWI bus address for the slave device when reading data from it.
*/
- #define TWI_ADDRESS_READ 0x00
+ #define TWI_ADDRESS_READ 0x01
/** TWI slave device address mask for a write session. Mask with a slave device base address to obtain
* the correct TWI bus address for the slave device when writing data to it.
*/
- #define TWI_ADDRESS_WRITE 0x01
+ #define TWI_ADDRESS_WRITE 0x00
/** Mask to retrieve the base address for a TWI device, which can then be ORed with \ref TWI_ADDRESS_READ
* or \ref TWI_ADDRESS_WRITE to obtain the device's read and write address respectively.