spicmds: Add Kconfig option to allow boards to disable SPI commands

Some boards may not support SPI transfers.  Update the build so that
those commands do not need to be compiled if they are not available.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
Kevin O'Connor 2016-06-08 19:35:45 -04:00
parent 71947d6bea
commit c20f993747
3 changed files with 6 additions and 1 deletions

View File

@ -18,6 +18,9 @@ source "src/simulator/Kconfig"
config HAVE_GPIO_ADC config HAVE_GPIO_ADC
bool bool
default n default n
config HAVE_GPIO_SPI
bool
default n
config INLINE_STEPPER_HACK config INLINE_STEPPER_HACK
# Enables gcc to inline stepper_event() into the main timer irq handler # Enables gcc to inline stepper_event() into the main timer irq handler

View File

@ -1,4 +1,5 @@
# Main code build rules # Main code build rules
src-y += sched.c command.c stepper.c basecmd.c gpiocmds.c spicmds.c endstop.c src-y += sched.c command.c stepper.c basecmd.c gpiocmds.c endstop.c
src-$(CONFIG_HAVE_GPIO_ADC) += adccmds.c src-$(CONFIG_HAVE_GPIO_ADC) += adccmds.c
src-$(CONFIG_HAVE_GPIO_SPI) += spicmds.c

View File

@ -6,6 +6,7 @@ config AVR_SELECT
bool bool
default y default y
select HAVE_GPIO_ADC select HAVE_GPIO_ADC
select HAVE_GPIO_SPI
config BOARD_DIRECTORY config BOARD_DIRECTORY
string string