Skip to content

Commit 837a5b8

Browse files
galaknashif
authored andcommitted
tests: i2c_slave_api: Fix define usage
The code should be using I2C_SLAVE_FLAGS_ADDR_10_BITS and not I2C_ADDR_10_BITS. Signed-off-by: Kumar Gala <[email protected]>
1 parent eb94546 commit 837a5b8

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

tests/drivers/i2c/i2c_slave_api/common/i2c_virtual.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ static struct i2c_slave_config *find_address(struct i2c_virtual_data *data,
3636
SYS_SLIST_FOR_EACH_NODE(&data->slaves, node) {
3737
cfg = CONTAINER_OF(node, struct i2c_slave_config, node);
3838

39-
search_10bit = (cfg->flags & I2C_ADDR_10_BITS);
39+
search_10bit = (cfg->flags & I2C_SLAVE_FLAGS_ADDR_10_BITS);
4040

4141
if (cfg->address == address && search_10bit == is_10bit) {
4242
return cfg;
@@ -58,7 +58,7 @@ int i2c_virtual_slave_register(const struct device *dev,
5858

5959
/* Check the address is unique */
6060
if (find_address(data, config->address,
61-
(config->flags & I2C_ADDR_10_BITS))) {
61+
(config->flags & I2C_SLAVE_FLAGS_ADDR_10_BITS))) {
6262
return -EINVAL;
6363
}
6464

@@ -157,7 +157,7 @@ static int i2c_virtual_transfer(const struct device *dev, struct i2c_msg *msg,
157157
bool is_write = false;
158158
int ret = 0;
159159

160-
cfg = find_address(data, slave, (msg->flags & I2C_ADDR_10_BITS));
160+
cfg = find_address(data, slave, (msg->flags & I2C_SLAVE_FLAGS_ADDR_10_BITS));
161161
if (!cfg) {
162162
return -EIO;
163163
}

0 commit comments

Comments
 (0)