fix(drivers): Avoid build failures for GPIO driver

* Avoid defining the ZMK GPIO drivers lib if none of the drivers  are
  selected.
This commit is contained in:
Peter Johanson 2022-06-05 05:56:45 +00:00 committed by Pete Johanson
parent 505c481f6a
commit b5e73204e8
4 changed files with 6 additions and 1 deletions

View File

@ -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)

View File

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

View File

@ -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.

View File

@ -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.