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.
This commit is contained in:
Dean Camera 2011-08-22 13:03:56 +00:00
parent 40946a5704
commit d0ac8e46f9
8 changed files with 61 additions and 34 deletions

View file

@ -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;

View file

@ -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.