Skip to content

Commit

Permalink
[conf][subsystem] only error if devices not configured for ap target
Browse files Browse the repository at this point in the history
  • Loading branch information
flixr committed Sep 9, 2013
1 parent b0997d4 commit db924c7
Show file tree
Hide file tree
Showing 9 changed files with 34 additions and 8 deletions.
2 changes: 2 additions & 0 deletions conf/firmwares/subsystems/shared/actuators_asctec.makefile
Expand Up @@ -17,9 +17,11 @@ else ifeq ($(ARCH), stm32)
ACTUATORS_ASCTEC_I2C_DEV ?= i2c1
endif

ifeq ($(TARGET), ap)
ifndef ACTUATORS_ASCTEC_I2C_DEV
$(error Error: ACTUATORS_ASCTEC_I2C_DEV not configured!)
endif
endif

# convert i2cx to upper/lower case
ACTUATORS_ASCTEC_I2C_DEV_UPPER=$(shell echo $(ACTUATORS_ASCTEC_I2C_DEV) | tr a-z A-Z)
Expand Down
2 changes: 2 additions & 0 deletions conf/firmwares/subsystems/shared/actuators_asctec_v2.makefile
Expand Up @@ -17,9 +17,11 @@ else ifeq ($(ARCH), stm32)
ACTUATORS_ASCTEC_V2_I2C_DEV ?= i2c1
endif

ifeq ($(TARGET), ap)
ifndef ACTUATORS_ASCTEC_V2_I2C_DEV
$(error Error: ACTUATORS_ASCTEC_V2_I2C_DEV not configured!)
endif
endif

# convert i2cx to upper/lower case
ACTUATORS_ASCTEC_V2_I2C_DEV_UPPER=$(shell echo $(ACTUATORS_ASCTEC_V2_I2C_DEV) | tr a-z A-Z)
Expand Down
2 changes: 2 additions & 0 deletions conf/firmwares/subsystems/shared/actuators_mkk.makefile
Expand Up @@ -32,9 +32,11 @@ else ifeq ($(ARCH), stm32)
ACTUATORS_MKK_I2C_DEV ?= i2c1
endif

ifeq ($(TARGET), ap)
ifndef ACTUATORS_MKK_I2C_DEV
$(error Error: ACTUATORS_MKK_I2C_DEV not configured!)
endif
endif

# convert i2cx to upper/lower case
ACTUATORS_MKK_I2C_DEV_UPPER=$(shell echo $(ACTUATORS_MKK_I2C_DEV) | tr a-z A-Z)
Expand Down
2 changes: 2 additions & 0 deletions conf/firmwares/subsystems/shared/actuators_mkk_v2.makefile
Expand Up @@ -31,9 +31,11 @@ else ifeq ($(ARCH), stm32)
ACTUATORS_MKK_V2_I2C_DEV ?= i2c1
endif

ifeq ($(TARGET), ap)
ifndef ACTUATORS_MKK_V2_I2C_DEV
$(error Error: ACTUATORS_MKK_V2_I2C_DEV not configured!)
endif
endif

# convert i2cx to upper/lower case
ACTUATORS_MKK_V2_I2C_DEV_UPPER=$(shell echo $(ACTUATORS_MKK_V2_I2C_DEV) | tr a-z A-Z)
Expand Down
2 changes: 2 additions & 0 deletions conf/firmwares/subsystems/shared/actuators_skiron.makefile
Expand Up @@ -27,9 +27,11 @@ else ifeq ($(ARCH), stm32)
ACTUATORS_SKIRON_I2C_DEV ?= i2c1
endif

ifeq ($(TARGET), ap)
ifndef ACTUATORS_SKIRON_I2C_DEV
$(error Error: ACTUATORS_SKIRON_I2C_DEV not configured!)
endif
endif

# convert i2cx to upper/lower case
ACTUATORS_SKIRON_I2C_DEV_UPPER=$(shell echo $(ACTUATORS_SKIRON_I2C_DEV) | tr a-z A-Z)
Expand Down
2 changes: 2 additions & 0 deletions conf/firmwares/subsystems/shared/imu_aspirin2_i2c.makefile
Expand Up @@ -14,9 +14,11 @@ else ifeq ($(ARCH), stm32)
IMU_ASPIRIN2_I2C_DEV ?= i2c2
endif

ifeq ($(TARGET), ap)
ifndef IMU_ASPIRIN2_I2C_DEV
$(error Error: IMU_ASPIRIN2_I2C_DEV not configured!)
endif
endif

# convert i2cx to upper/lower case
IMU_ASPIRIN2_I2C_DEV_UPPER=$(shell echo $(IMU_ASPIRIN2_I2C_DEV) | tr a-z A-Z)
Expand Down
11 changes: 11 additions & 0 deletions conf/firmwares/subsystems/shared/imu_aspirin_common.makefile
Expand Up @@ -52,9 +52,11 @@ else ifeq ($(ARCH), stm32)
ASPIRIN_I2C_DEV ?= i2c2
endif

ifeq ($(TARGET), ap)
ifndef ASPIRIN_I2C_DEV
$(error Error: ASPIRIN_I2C_DEV not configured!)
endif
endif

# convert i2cx to upper/lower case
ASPIRIN_I2C_DEV_UPPER=$(shell echo $(ASPIRIN_I2C_DEV) | tr a-z A-Z)
Expand All @@ -75,6 +77,15 @@ ASPIRIN_SPI_DEV ?= spi2
ASPIRIN_SPI_SLAVE_IDX ?= SPI_SLAVE2
endif

ifeq ($(TARGET), ap)
ifndef ASPIRIN_SPI_DEV
$(error Error: ASPIRIN_SPI_DEV not configured!)
endif
ifndef ASPIRIN_SPI_SLAVE_IDX
$(error Error: ASPIRIN_SPI_SLAVE_IDX not configured!)
endif
endif

# convert spix to upper/lower case
ASPIRIN_SPI_DEV_UPPER=$(shell echo $(ASPIRIN_SPI_DEV) | tr a-z A-Z)
ASPIRIN_SPI_DEV_LOWER=$(shell echo $(ASPIRIN_SPI_DEV) | tr A-Z a-z)
Expand Down
Expand Up @@ -46,9 +46,11 @@ else ifeq ($(ARCH), stm32)
ASPIRIN_I2C_DEV ?= i2c2
endif

ifeq ($(TARGET), ap)
ifndef ASPIRIN_I2C_DEV
$(error Error: ASPIRIN_I2C_DEV not configured!)
endif
endif

# convert i2cx to upper/lower case
ASPIRIN_I2C_DEV_UPPER=$(shell echo $(ASPIRIN_I2C_DEV) | tr a-z A-Z)
Expand Down
17 changes: 9 additions & 8 deletions conf/firmwares/subsystems/shared/imu_aspirin_v2_common.makefile
Expand Up @@ -54,20 +54,21 @@ include $(CFG_SHARED)/spi_master.makefile
# SPI device and slave select defaults
#
ifeq ($(ARCH), lpc21)
ifndef ASPIRIN_2_SPI_DEV
ASPIRIN_2_SPI_DEV = spi1
endif
ifndef ASPIRIN_2_SPI_SLAVE_IDX
ASPIRIN_2_SPI_SLAVE_IDX = SPI_SLAVE0
endif
ASPIRIN_2_SPI_DEV ?= spi1
ASPIRIN_2_SPI_SLAVE_IDX ?= SPI_SLAVE0
else ifeq ($(ARCH), stm32)
# Slave select configuration
# SLAVE2 is on PB12 (NSS) (MPU600 CS)
ASPIRIN_2_SPI_DEV ?= spi2
ASPIRIN_2_SPI_SLAVE_IDX ?= SPI_SLAVE2
endif

ifeq ($(TARGET), ap)
ifndef ASPIRIN_2_SPI_DEV
ASPIRIN_2_SPI_DEV = spi2
$(error Error: ASPIRIN_2_SPI_DEV not configured!)
endif
ifndef ASPIRIN_2_SPI_SLAVE_IDX
ASPIRIN_2_SPI_SLAVE_IDX = SPI_SLAVE2
$(error Error: ASPIRIN_2_SPI_SLAVE_IDX not configured!)
endif
endif

Expand Down

0 comments on commit db924c7

Please sign in to comment.