Skip to content

Commit 4b77054

Browse files
committed
Fix I2C slave address
Remove the needless bit shift for I2C slave address.
1 parent 9e5a779 commit 4b77054

File tree

1 file changed

+1
-1
lines changed
  • hal/targets/hal/TARGET_Freescale/TARGET_KSDK2_MCUS/api

1 file changed

+1
-1
lines changed

hal/targets/hal/TARGET_Freescale/TARGET_KSDK2_MCUS/api/i2c_api.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ int i2c_slave_write(i2c_t *obj, const char *data, int length) {
233233
}
234234

235235
void i2c_slave_address(i2c_t *obj, int idx, uint32_t address, uint32_t mask) {
236-
i2c_addrs[obj->instance]->A1 = ((uint32_t)(address)) << 1U;
236+
i2c_addrs[obj->instance]->A1 = address & 0xfe;
237237
}
238238
#endif
239239

0 commit comments

Comments
 (0)