Browse Source

fix(drivers): Avoid build failures for GPIO driver

* Avoid defining the ZMK GPIO drivers lib if none of the drivers  are
  selected.
xmkb
Peter Johanson 2 years ago committed by Pete Johanson
parent
commit
b5e73204e8
  1. 2
      app/drivers/CMakeLists.txt
  2. 3
      app/drivers/gpio/Kconfig
  3. 1
      app/drivers/gpio/Kconfig.595
  4. 1
      app/drivers/gpio/Kconfig.mcp23017

2
app/drivers/CMakeLists.txt

@ -1,7 +1,7 @@ @@ -1,7 +1,7 @@
# Copyright (c) 2020 The ZMK Contributors
# SPDX-License-Identifier: MIT
add_subdirectory(gpio)
add_subdirectory_ifdef(CONFIG_ZMK_DRIVERS_GPIO gpio)
add_subdirectory(kscan)
add_subdirectory(sensor)
add_subdirectory(display)

3
app/drivers/gpio/Kconfig

@ -1,2 +1,5 @@ @@ -1,2 +1,5 @@
menuconfig ZMK_DRIVERS_GPIO
bool "GPIO"
rsource "Kconfig.mcp23017"
rsource "Kconfig.595"

1
app/drivers/gpio/Kconfig.595

@ -10,6 +10,7 @@ menuconfig GPIO_595 @@ -10,6 +10,7 @@ menuconfig GPIO_595
default $(dt_compat_enabled,$(DT_COMPAT_ZMK_GPIO_595))
depends on SPI
select HAS_DTS_GPIO
select ZMK_DRIVERS_GPIO
help
Enable driver for 595 shift register chip using SPI.

1
app/drivers/gpio/Kconfig.mcp23017

@ -7,6 +7,7 @@ menuconfig GPIO_MCP23017 @@ -7,6 +7,7 @@ menuconfig GPIO_MCP23017
bool "MCP23017 I2C-based GPIO chip"
depends on I2C
select HAS_DTS_GPIO
select ZMK_DRIVERS_GPIO
help
Enable driver for MCP23017 I2C-based GPIO chip.

Loading…
Cancel
Save