aboutsummaryrefslogtreecommitdiffstats
path: root/src/sensor_lis2dw.c
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2025-04-09 12:36:24 -0400
committerKevin O'Connor <kevin@koconnor.net>2025-04-16 13:54:44 -0400
commit04e7eb20fd9b65addcbb4773fdb7b6be9dbf6195 (patch)
tree5a57fe1f0a283e8b5e07a257fdd2af85c493cd50 /src/sensor_lis2dw.c
parent868760f5b1013843aff7390bb94adfb4cb3fe679 (diff)
downloadkutter-04e7eb20fd9b65addcbb4773fdb7b6be9dbf6195.tar.gz
kutter-04e7eb20fd9b65addcbb4773fdb7b6be9dbf6195.tar.xz
kutter-04e7eb20fd9b65addcbb4773fdb7b6be9dbf6195.zip
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 <kevin@koconnor.net>
Diffstat (limited to 'src/sensor_lis2dw.c')
-rw-r--r--src/sensor_lis2dw.c6
1 files changed, 3 insertions, 3 deletions
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];