Update I2CSlave.cpp

Added comments regarding the need for dedicated i2c_slave_byte_write() and  i2c_slave_byte_read() functions.
pull/881/head
Wim 2015-02-06 21:11:29 +01:00
parent 5356a00770
commit 83d87140aa
1 changed files with 2 additions and 11 deletions

View File

@ -46,13 +46,8 @@ int I2CSlave::read(void) {
// The dedicated I2C Slave byte read and byte write functions need to be called // The dedicated I2C Slave byte read and byte write functions need to be called
// from 'common' mbed I2CSlave API for devices that have separate Master and // from 'common' mbed I2CSlave API for devices that have separate Master and
// Slave engines such as the lpc812 and lpc1549. // Slave engines such as the lpc812 and lpc1549.
// // return i2c_slave_byte_read(&_i2c, 0);
//#if defined (TARGET_LPC812) || defined (TARGET_LPC824) || defined (TARGET_LPC1549)
#if defined (TARGET_LPC812)
return i2c_slave_byte_read(&_i2c, 0);
#else
return i2c_byte_read(&_i2c, 0); return i2c_byte_read(&_i2c, 0);
#endif
} }
int I2CSlave::write(const char *data, int length) { int I2CSlave::write(const char *data, int length) {
@ -64,12 +59,8 @@ int I2CSlave::write(int data) {
// from 'common' mbed I2CSlave API for devices that have separate Master and // from 'common' mbed I2CSlave API for devices that have separate Master and
// Slave engines such as the lpc812 and lpc1549. // Slave engines such as the lpc812 and lpc1549.
// //
//#if defined (TARGET_LPC812) || defined (TARGET_LPC824) || defined (TARGET_LPC1549) // return i2c_slave_byte_write(&_i2c, data);
#if defined (TARGET_LPC812)
return i2c_slave_byte_write(&_i2c, data);
#else
return i2c_byte_write(&_i2c, data); return i2c_byte_write(&_i2c, data);
#endif
} }
void I2CSlave::stop(void) { void I2CSlave::stop(void) {