From 4b77054940595f5c4eb1ff65d598461075acb584 Mon Sep 17 00:00:00 2001 From: lrks Date: Sun, 10 Jul 2016 10:34:13 +0900 Subject: [PATCH] Fix I2C slave address Remove the needless bit shift for I2C slave address. --- .../hal/TARGET_Freescale/TARGET_KSDK2_MCUS/api/i2c_api.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hal/targets/hal/TARGET_Freescale/TARGET_KSDK2_MCUS/api/i2c_api.c b/hal/targets/hal/TARGET_Freescale/TARGET_KSDK2_MCUS/api/i2c_api.c index e549047c22..84e38993d8 100644 --- a/hal/targets/hal/TARGET_Freescale/TARGET_KSDK2_MCUS/api/i2c_api.c +++ b/hal/targets/hal/TARGET_Freescale/TARGET_KSDK2_MCUS/api/i2c_api.c @@ -233,7 +233,7 @@ int i2c_slave_write(i2c_t *obj, const char *data, int length) { } void i2c_slave_address(i2c_t *obj, int idx, uint32_t address, uint32_t mask) { - i2c_addrs[obj->instance]->A1 = ((uint32_t)(address)) << 1U; + i2c_addrs[obj->instance]->A1 = address & 0xfe; } #endif