From 04e7eb20fd9b65addcbb4773fdb7b6be9dbf6195 Mon Sep 17 00:00:00 2001 From: Kevin O'Connor Date: Wed, 9 Apr 2025 12:36:24 -0400 Subject: Kconfig: Add new WANT_I2C option to reduce code size Make it possible to not compile in support for I2C on chips with small flash sizes. Signed-off-by: Kevin O'Connor --- src/sensor_lis2dw.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/sensor_lis2dw.c') diff --git a/src/sensor_lis2dw.c b/src/sensor_lis2dw.c index d4108667..bf4beba1 100644 --- a/src/sensor_lis2dw.c +++ b/src/sensor_lis2dw.c @@ -85,7 +85,7 @@ command_config_lis2dw(uint32_t *args) shutdown("bus_type spi unsupported"); } case I2C_SERIAL: - if (CONFIG_HAVE_GPIO_I2C) { + if (CONFIG_WANT_I2C) { ax->i2c = i2cdev_oid_lookup(args[1]); ax->bus_type = I2C_SERIAL; break; @@ -147,7 +147,7 @@ lis2dw_query(struct lis2dw *ax, uint8_t oid) for (uint32_t i = 0; i < BYTES_PER_SAMPLE; i++) d[i] = msg[i + 1]; - } else if (CONFIG_HAVE_GPIO_I2C && ax->bus_type == I2C_SERIAL) { + } else if (CONFIG_WANT_I2C && ax->bus_type == I2C_SERIAL) { uint8_t msg_reg[] = {LIS_AR_DATAX0}; if (ax->model == LIS3DH) msg_reg[0] |= LIS_MS_I2C; @@ -226,7 +226,7 @@ command_query_lis2dw_status(uint32_t *args) spidev_transfer(ax->spi, 1, sizeof(msg), msg); time2 = timer_read_time(); status = msg[1]; - } else if (CONFIG_HAVE_GPIO_I2C && ax->bus_type == I2C_SERIAL) { + } else if (CONFIG_WANT_I2C && ax->bus_type == I2C_SERIAL) { uint8_t fifo_reg[1] = {LIS_FIFO_SAMPLES}; uint8_t fifo[1]; -- cgit v1.2.3-70-g09d2