diff options
author | Kevin O'Connor <kevin@koconnor.net> | 2025-04-09 12:23:28 -0400 |
---|---|---|
committer | Kevin O'Connor <kevin@koconnor.net> | 2025-04-16 13:54:44 -0400 |
commit | 868760f5b1013843aff7390bb94adfb4cb3fe679 (patch) | |
tree | 55b8cc20abcb408e91e3a1648718f4a1266799e5 /src/sensor_lis2dw.c | |
parent | b0fa36e221959ad88b005fca856adede82427321 (diff) | |
download | kutter-868760f5b1013843aff7390bb94adfb4cb3fe679.tar.gz kutter-868760f5b1013843aff7390bb94adfb4cb3fe679.tar.xz kutter-868760f5b1013843aff7390bb94adfb4cb3fe679.zip |
Kconfig: Add new WANT_SPI option to reduce code size
Make it possible to not compile in support for SPI 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.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/sensor_lis2dw.c b/src/sensor_lis2dw.c index 8a4a6a66..d4108667 100644 --- a/src/sensor_lis2dw.c +++ b/src/sensor_lis2dw.c @@ -6,7 +6,7 @@ // This file may be distributed under the terms of the GNU GPLv3 license. #include <string.h> // memcpy -#include "autoconf.h" // CONFIG_HAVE_GPIO_SPI +#include "autoconf.h" // CONFIG_WANT_SPI #include "board/gpio.h" // irq_disable #include "board/irq.h" // irq_disable #include "board/misc.h" // timer_read_time @@ -77,7 +77,7 @@ command_config_lis2dw(uint32_t *args) switch (args[2]) { case SPI_SERIAL: - if (CONFIG_HAVE_GPIO_SPI) { + if (CONFIG_WANT_SPI) { ax->spi = spidev_oid_lookup(args[1]); ax->bus_type = SPI_SERIAL; break; @@ -126,7 +126,7 @@ lis2dw_query(struct lis2dw *ax, uint8_t oid) uint8_t fifo_ovrn = 0; uint8_t *d = &ax->sb.data[ax->sb.data_count]; - if (CONFIG_HAVE_GPIO_SPI && ax->bus_type == SPI_SERIAL) { + if (CONFIG_WANT_SPI && ax->bus_type == SPI_SERIAL) { uint8_t msg[7] = {0}; uint8_t fifo[2] = {LIS_FIFO_SAMPLES | LIS_AM_READ , 0}; @@ -220,7 +220,7 @@ command_query_lis2dw_status(uint32_t *args) uint32_t time2 = 0; uint8_t status = 0; - if (CONFIG_HAVE_GPIO_SPI && ax->bus_type == SPI_SERIAL) { + if (CONFIG_WANT_SPI && ax->bus_type == SPI_SERIAL) { uint8_t msg[2] = { LIS_FIFO_SAMPLES | LIS_AM_READ, 0x00 }; time1 = timer_read_time(); spidev_transfer(ax->spi, 1, sizeof(msg), msg); |