build: Allow boards to disable digital input/output support

Allow the micro-controller code to be built without support for
regular gpio pins.  In this case, the code for endstops, steppers, and
gpiocmds will be disabled.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
Kevin O'Connor 2017-07-19 23:59:35 -04:00
parent 649d26e093
commit 4a6254fac3
6 changed files with 17 additions and 1 deletions

View File

@ -21,6 +21,9 @@ source "src/simulator/Kconfig"
# The HAVE_GPIO_x options allow boards to disable support for some # The HAVE_GPIO_x options allow boards to disable support for some
# commands if the hardware does not support the feature. # commands if the hardware does not support the feature.
config HAVE_GPIO
bool
default n
config HAVE_GPIO_ADC config HAVE_GPIO_ADC
bool bool
default n default n
@ -41,4 +44,5 @@ config NO_UNSTEP_DELAY
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
bool bool
depends on HAVE_GPIO
default y default y

View File

@ -1,6 +1,7 @@
# Main code build rules # Main code build rules
src-y += sched.c command.c stepper.c basecmd.c debugcmds.c gpiocmds.c endstop.c src-y += sched.c command.c basecmd.c debugcmds.c
src-$(CONFIG_HAVE_GPIO) += gpiocmds.c stepper.c endstop.c
src-$(CONFIG_HAVE_GPIO_ADC) += adccmds.c src-$(CONFIG_HAVE_GPIO_ADC) += adccmds.c
src-$(CONFIG_HAVE_GPIO_SPI) += spicmds.c src-$(CONFIG_HAVE_GPIO_SPI) += spicmds.c
src-$(CONFIG_HAVE_GPIO_HARD_PWM) += pwmcmds.c src-$(CONFIG_HAVE_GPIO_HARD_PWM) += pwmcmds.c

View File

@ -5,6 +5,7 @@ if MACH_AVR
config AVR_SELECT config AVR_SELECT
bool bool
default y default y
select HAVE_GPIO
select HAVE_GPIO_ADC select HAVE_GPIO_ADC
select HAVE_GPIO_SPI select HAVE_GPIO_SPI
select HAVE_GPIO_HARD_PWM select HAVE_GPIO_HARD_PWM

View File

@ -5,6 +5,7 @@ if MACH_PRU
config PRU_SELECT config PRU_SELECT
bool bool
default y default y
select HAVE_GPIO
select HAVE_GPIO_ADC select HAVE_GPIO_ADC
config BOARD_DIRECTORY config BOARD_DIRECTORY

View File

@ -5,6 +5,7 @@ if MACH_SAM3X8E
config SAM_SELECT config SAM_SELECT
bool bool
default y default y
select HAVE_GPIO
select HAVE_GPIO_ADC select HAVE_GPIO_ADC
config BOARD_DIRECTORY config BOARD_DIRECTORY

View File

@ -7,4 +7,12 @@ config BOARD_DIRECTORY
string string
default "simulator" default "simulator"
config SIMULATOR_SELECT
bool
default y
select HAVE_GPIO
select HAVE_GPIO_ADC
select HAVE_GPIO_SPI
select HAVE_GPIO_HARD_PWM
endif endif