aboutsummaryrefslogtreecommitdiffstats
path: root/LUFA/Drivers/Peripheral
diff options
context:
space:
mode:
authorDean Camera <dean@fourwalledcubicle.com>2011-08-22 13:03:56 +0000
committerDean Camera <dean@fourwalledcubicle.com>2011-08-22 13:03:56 +0000
commitd0ac8e46f958e81f78876740202ca489569f5689 (patch)
tree43b71715d52e266156428023db2b83b81cf3f540 /LUFA/Drivers/Peripheral
parent40946a570405a522b2cd04295bc2dad746b936fc (diff)
downloadlufa-d0ac8e46f958e81f78876740202ca489569f5689.tar.gz
lufa-d0ac8e46f958e81f78876740202ca489569f5689.tar.bz2
lufa-d0ac8e46f958e81f78876740202ca489569f5689.zip
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.
Diffstat (limited to 'LUFA/Drivers/Peripheral')
-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 2f65921ca..d4f594f3b 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 c35499eff..63b9f03c6 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.