Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of mbed-src by
Diff: targets/hal/TARGET_NXP/TARGET_LPC82X/i2c_api.c
- Revision:
- 350:a00142a134db
- Parent:
- 337:6ed01c00b962
- Child:
- 366:2c37f9c21d44
--- a/targets/hal/TARGET_NXP/TARGET_LPC82X/i2c_api.c Wed Oct 15 07:15:06 2014 +0100
+++ b/targets/hal/TARGET_NXP/TARGET_LPC82X/i2c_api.c Wed Oct 15 10:15:06 2014 +0100
@@ -228,7 +228,7 @@
memcpy(data, buf + 1, i2c_result.n_bytes_recd);
free(buf);
if (err == 0)
- return i2c_result.n_bytes_recd;
+ return i2c_result.n_bytes_recd - 1;
else
return -1;
}
@@ -248,7 +248,7 @@
err = LPC_I2CD_API->i2c_master_transmit_poll(obj->handler, &i2c_param, &i2c_result);
free(buf);
if (err == 0)
- return i2c_result.n_bytes_sent;
+ return i2c_result.n_bytes_sent - 1;
else
return -1;
}
@@ -282,7 +282,7 @@
#if DEVICE_I2CSLAVE
- void i2c_slave_mode(i2c_t *obj, int enable_slave)
+void i2c_slave_mode(i2c_t *obj, int enable_slave)
{
obj->handler = LPC_I2CD_API->i2c_setup((uint32_t)(obj->i2c), i2c_buffer);
if (enable_slave != 0) {
