mirror of
https://github.com/paparazzi/paparazzi.git
synced 2026-05-21 03:43:26 +08:00
[build] add case modifier to modules' makefile
- this allow to use lower and upper version of a makefile variable. - can also be use to provide default value to some variables.
This commit is contained in:
@@ -34,11 +34,7 @@
|
||||
<event fun="AirspeedAmsysEvent()"/>
|
||||
|
||||
<makefile>
|
||||
<raw>
|
||||
AIRSPEED_AMSYS_I2C_DEV ?= i2c0
|
||||
AIRSPEED_AMSYS_I2C_DEV_LOWER=$(shell echo $(AIRSPEED_AMSYS_I2C_DEV) | tr A-Z a-z)
|
||||
AIRSPEED_AMSYS_I2C_DEV_UPPER=$(shell echo $(AIRSPEED_AMSYS_I2C_DEV) | tr a-z A-Z)
|
||||
</raw>
|
||||
<configure name="AIRSPEED_AMSYS_I2C_DEV" value="i2c0" default="TRUE" case="upper|lower"/>
|
||||
<define name="USE_$(AIRSPEED_AMSYS_I2C_DEV_UPPER)"/>
|
||||
<define name="AIRSPEED_AMSYS_I2C_DEV" value="$(AIRSPEED_AMSYS_I2C_DEV_LOWER)"/>
|
||||
<file name="airspeed_amsys.c"/>
|
||||
|
||||
@@ -36,11 +36,7 @@
|
||||
<event fun="AirspeedEtsEvent()"/>
|
||||
|
||||
<makefile>
|
||||
<raw>
|
||||
AIRSPEED_ETS_I2C_DEV ?= i2c0
|
||||
AIRSPEED_ETS_I2C_DEV_LOWER=$(shell echo $(AIRSPEED_ETS_I2C_DEV) | tr A-Z a-z)
|
||||
AIRSPEED_ETS_I2C_DEV_UPPER=$(shell echo $(AIRSPEED_ETS_I2C_DEV) | tr a-z A-Z)
|
||||
</raw>
|
||||
<configure name="AIRSPEED_ETS_I2C_DEV" value="i2c0" default="TRUE" case="upper|lower"/>
|
||||
<define name="USE_$(AIRSPEED_ETS_I2C_DEV_UPPER)"/>
|
||||
<define name="AIRSPEED_ETS_I2C_DEV" value="$(AIRSPEED_ETS_I2C_DEV_LOWER)"/>
|
||||
<file name="airspeed_ets.c"/>
|
||||
|
||||
@@ -22,13 +22,11 @@
|
||||
<periodic fun="airspeed_otf_periodic()" freq="1"/>
|
||||
<event fun="airspeed_otf_event()"/>
|
||||
<makefile target="ap">
|
||||
<raw>
|
||||
OTF_UART_LOWER=$(shell echo $(OTF_UART) | tr A-Z a-z)
|
||||
</raw>
|
||||
<configure name="OTF_UART" case="upper|lower"/>
|
||||
<file name="airspeed_otf.c"/>
|
||||
<define name="USE_$(OTF_UART)"/>
|
||||
<define name="USE_$(OTF_UART_UPPER)"/>
|
||||
<define name="MET_LINK" value="$(OTF_UART_LOWER)"/>
|
||||
<define name="$(OTF_UART)_BAUD" value="B115200"/>
|
||||
<define name="$(OTF_UART_UPPER)_BAUD" value="B115200"/>
|
||||
</makefile>
|
||||
</module>
|
||||
|
||||
|
||||
@@ -30,11 +30,7 @@
|
||||
<event fun="BaroAmsysEvent()"/>
|
||||
|
||||
<makefile target="ap">
|
||||
<raw>
|
||||
BARO_AMSYS_I2C_DEV ?= i2c0
|
||||
BARO_AMSYS_I2C_DEV_LOWER=$(shell echo $(BARO_AMSYS_I2C_DEV) | tr A-Z a-z)
|
||||
BARO_AMSYS_I2C_DEV_UPPER=$(shell echo $(BARO_AMSYS_I2C_DEV) | tr a-z A-Z)
|
||||
</raw>
|
||||
<configure name="BARO_AMSYS_I2C_DEV" value="i2c0" default="TRUE" case="upper|lower"/>
|
||||
<define name="USE_$(BARO_AMSYS_I2C_DEV_UPPER)"/>
|
||||
<define name="BARO_AMSYS_I2C_DEV" value="$(BARO_AMSYS_I2C_DEV_LOWER)"/>
|
||||
<file name="baro_amsys.c"/>
|
||||
|
||||
@@ -13,11 +13,7 @@
|
||||
<periodic fun="baro_bmp_periodic()" freq="15"/>
|
||||
<event fun="baro_bmp_event()"/>
|
||||
<makefile target="ap">
|
||||
<raw>
|
||||
BMP_I2C_DEV ?= i2c0
|
||||
BMP_I2C_DEV_LOWER=$(shell echo $(BMP_I2C_DEV) | tr A-Z a-z)
|
||||
BMP_I2C_DEV_UPPER=$(shell echo $(BMP_I2C_DEV) | tr a-z A-Z)
|
||||
</raw>
|
||||
<configure name="BMP_I2C_DEV" value="i2c0" default="TRUE" case="upper|lower"/>
|
||||
<define name="USE_$(BMP_I2C_DEV_UPPER)"/>
|
||||
<define name="BMP_I2C_DEV" value="$(BMP_I2C_DEV_LOWER)"/>
|
||||
<file name="baro_bmp.c"/>
|
||||
|
||||
@@ -34,11 +34,7 @@
|
||||
<event fun="BaroEtsEvent()"/>
|
||||
|
||||
<makefile target="ap">
|
||||
<raw>
|
||||
BARO_ETS_I2C_DEV ?= i2c0
|
||||
BARO_ETS_I2C_DEV_LOWER=$(shell echo $(BARO_ETS_I2C_DEV) | tr A-Z a-z)
|
||||
BARO_ETS_I2C_DEV_UPPER=$(shell echo $(BARO_ETS_I2C_DEV) | tr a-z A-Z)
|
||||
</raw>
|
||||
<configure name="BARO_ETS_I2C_DEV" value="i2c0" default="TRUE" case="upper|lower"/>
|
||||
<define name="USE_$(BARO_ETS_I2C_DEV_UPPER)"/>
|
||||
<define name="BARO_ETS_I2C_DEV" value="$(BARO_ETS_I2C_DEV_LOWER)"/>
|
||||
<file name="baro_ets.c"/>
|
||||
|
||||
@@ -14,11 +14,7 @@
|
||||
<event fun="BaroHcaEvent()"/>
|
||||
|
||||
<makefile target="ap">
|
||||
<raw>
|
||||
BARO_HCA_I2C_DEV ?= i2c0
|
||||
BARO_HCA_I2C_DEV_LOWER=$(shell echo $(BARO_HCA_I2C_DEV) | tr A-Z a-z)
|
||||
BARO_HCA_I2C_DEV_UPPER=$(shell echo $(BARO_HCA_I2C_DEV) | tr a-z A-Z)
|
||||
</raw>
|
||||
<configure name="BARO_HCA_I2C_DEV" value="i2c0" default="TRUE" case="upper|lower"/>
|
||||
<define name="USE_$(BARO_HCA_I2C_DEV_UPPER)"/>
|
||||
<define name="BARO_HCA_I2C_DEV" value="$(BARO_HCA_I2C_DEV_LOWER)"/>
|
||||
<file name="baro_hca.c"/>
|
||||
|
||||
@@ -17,11 +17,7 @@
|
||||
<periodic fun="baro_ms5611_periodic_check()" freq="40"/>
|
||||
<event fun="baro_ms5611_event()"/>
|
||||
<makefile target="ap">
|
||||
<raw>
|
||||
MS5611_I2C_DEV ?= i2c0
|
||||
MS5611_I2C_DEV_LOWER=$(shell echo $(MS5611_I2C_DEV) | tr A-Z a-z)
|
||||
MS5611_I2C_DEV_UPPER=$(shell echo $(MS5611_I2C_DEV) | tr a-z A-Z)
|
||||
</raw>
|
||||
<configure name="MS5611_I2C_DEV" value="i2c0" default="TRUE" case="upper|lower"/>
|
||||
<define name="USE_$(MS5611_I2C_DEV_UPPER)"/>
|
||||
<define name="MS5611_I2C_DEV" value="$(MS5611_I2C_DEV_LOWER)"/>
|
||||
<file name="baro_ms5611_i2c.c"/>
|
||||
|
||||
@@ -18,15 +18,9 @@
|
||||
<periodic fun="baro_ms5611_periodic_check()" freq="40"/>
|
||||
<event fun="baro_ms5611_event()"/>
|
||||
<makefile target="ap">
|
||||
<configure name="MS5611_SPI_DEV" value="spi1" default="TRUE" case="upper|lower"/>
|
||||
<configure name="MS5611_SLAVE_IDX" value="spi_slave0" default="TRUE" case="upper|lower"/>
|
||||
<raw>
|
||||
MS5611_SPI_DEV ?= spi1
|
||||
MS5611_SPI_DEV_LOWER=$(shell echo $(MS5611_SPI_DEV) | tr A-Z a-z)
|
||||
MS5611_SPI_DEV_UPPER=$(shell echo $(MS5611_SPI_DEV) | tr a-z A-Z)
|
||||
|
||||
MS5611_SLAVE_IDX ?= spi_slave0
|
||||
MS5611_SLAVE_IDX_LOWER=$(shell echo $(MS5611_SLAVE_IDX) | tr A-Z a-z)
|
||||
MS5611_SLAVE_IDX_UPPER=$(shell echo $(MS5611_SLAVE_IDX) | tr a-z A-Z)
|
||||
|
||||
include $(CFG_SHARED)/spi_master.makefile
|
||||
</raw>
|
||||
<define name="USE_$(MS5611_SPI_DEV_UPPER)" />
|
||||
|
||||
@@ -13,11 +13,7 @@
|
||||
<periodic fun="baro_scp_periodic()" freq="1.8"/>
|
||||
<event fun="baro_scp_event()"/>
|
||||
<makefile target="ap">
|
||||
<raw>
|
||||
SCP_I2C_DEV ?= i2c0
|
||||
SCP_I2C_DEV_LOWER=$(shell echo $(SCP_I2C_DEV) | tr A-Z a-z)
|
||||
SCP_I2C_DEV_UPPER=$(shell echo $(SCP_I2C_DEV) | tr a-z A-Z)
|
||||
</raw>
|
||||
<configure name="SCP_I2C_DEV" value="i2c0" default="TRUE" case="upper|lower"/>
|
||||
<define name="USE_$(SCP_I2C_DEV_UPPER)"/>
|
||||
<define name="SCP_I2C_DEV" value="$(SCP_I2C_DEV_LOWER)"/>
|
||||
<file name="baro_scp_i2c.c"/>
|
||||
|
||||
@@ -27,11 +27,7 @@
|
||||
<datalink message="PAYLOAD_COMMAND" fun="ParseCameraCommand()"/>
|
||||
|
||||
<makefile target="ap">
|
||||
<raw>
|
||||
ATMEGA_I2C_DEV ?= i2c0
|
||||
ATMEGA_I2C_DEV_LOWER=$(shell echo $(ATMEGA_I2C_DEV) | tr A-Z a-z)
|
||||
ATMEGA_I2C_DEV_UPPER=$(shell echo $(ATMEGA_I2C_DEV) | tr a-z A-Z)
|
||||
</raw>
|
||||
<configure name="ATMEGA_I2C_DEV" value="i2c0" default="TRUE" case="upper|lower"/>
|
||||
<define name="USE_$(ATMEGA_I2C_DEV_UPPER)"/>
|
||||
<define name="ATMEGA_I2C_DEV" value="$(ATMEGA_I2C_DEV_LOWER)"/>
|
||||
<file name="atmega_i2c_cam_ctrl.c"/>
|
||||
|
||||
@@ -70,12 +70,10 @@
|
||||
<file name="uart_cam_ctrl.c"/>
|
||||
<file name="catia/protocol.c"/>
|
||||
<file name="dc.c"/>
|
||||
<raw>
|
||||
CAMERA_PORT_LOWER=$(shell echo $(CAMERA_PORT) | tr A-Z a-z)
|
||||
$(TARGET).CFLAGS += -D$(CAMERA_PORT)_BAUD=B115200
|
||||
</raw>
|
||||
<define name="USE_$(CAMERA_PORT)"/>
|
||||
<configure name="CAMERA_PORT" case="upper|lower"/>
|
||||
<define name="USE_$(CAMERA_PORT_UPPER)"/>
|
||||
<define name="CAMERA_LINK" value="$(CAMERA_PORT_LOWER)"/>
|
||||
<define name="$(CAMERA_PORT_UPPER)_BAUD" value="B115200"/>
|
||||
</makefile>
|
||||
</module>
|
||||
|
||||
|
||||
@@ -27,19 +27,10 @@
|
||||
<periodic fun="direct_memory_logger_periodic()" autorun="TRUE"/>
|
||||
|
||||
<makefile target="ap">
|
||||
<configure name="DM_LOG_UART" value="uart1" default="TRUE" case="upper|lower"/>
|
||||
<configure name="DM_LOG_SPI_DEV" value="spi2" default="TRUE" case="upper|lower"/>
|
||||
<configure name="DM_LOG_SPI_SLAVE_IDX" value="spi_slave1" default="TRUE" case="upper|lower"/>
|
||||
<raw>
|
||||
DM_LOG_UART ?= uart1
|
||||
DM_LOG_UART_LOWER=$(shell echo $(DM_LOG_UART) | tr A-Z a-z)
|
||||
DM_LOG_UART_UPPER=$(shell echo $(DM_LOG_UART) | tr a-z A-Z)
|
||||
|
||||
DM_LOG_SPI_DEV ?= spi2
|
||||
DM_LOG_SPI_DEV_LOWER=$(shell echo $(DM_LOG_SPI_DEV) | tr A-Z a-z)
|
||||
DM_LOG_SPI_DEV_UPPER=$(shell echo $(DM_LOG_SPI_DEV) | tr a-z A-Z)
|
||||
|
||||
DM_LOG_SPI_SLAVE_IDX ?= spi_slave1
|
||||
DM_LOG_SPI_SLAVE_IDX_LOWER=$(shell echo $(DM_LOG_SPI_SLAVE_IDX) | tr A-Z a-z)
|
||||
DM_LOG_SPI_SLAVE_IDX_UPPER=$(shell echo $(DM_LOG_SPI_SLAVE_IDX) | tr a-z A-Z)
|
||||
|
||||
include $(CFG_SHARED)/spi_master.makefile
|
||||
</raw>
|
||||
|
||||
|
||||
@@ -12,12 +12,10 @@
|
||||
<init fun="extra_pprz_dl_init()"/>
|
||||
<event fun="ExtraDatalinkEvent()"/>
|
||||
<makefile target="ap">
|
||||
<raw>
|
||||
EXTRA_DL_PORT_LOWER = $(shell echo $(EXTRA_DL_PORT) | tr A-Z a-z)
|
||||
</raw>
|
||||
<configure name="EXTRA_DL_PORT" case="upper|lower"/>
|
||||
<define name="EXTRA_DOWNLINK_DEVICE" value="$(EXTRA_DL_PORT_LOWER)"/>
|
||||
<define name="USE_$(EXTRA_DL_PORT)"/>
|
||||
<define name="$(EXTRA_DL_PORT)_BAUD" value="$(EXTRA_DL_BAUD)"/>
|
||||
<define name="USE_$(EXTRA_DL_PORT_UPPER)"/>
|
||||
<define name="$(EXTRA_DL_PORT_UPPER)_BAUD" value="$(EXTRA_DL_BAUD)"/>
|
||||
<file name="extra_pprz_dl.c"/>
|
||||
<file name="pprz_transport.c" dir="subsystems/datalink"/>
|
||||
</makefile>
|
||||
|
||||
@@ -14,11 +14,7 @@
|
||||
<event fun="ezcurrent_read_event()"/>
|
||||
|
||||
<makefile target="ap">
|
||||
<raw>
|
||||
EZCURRENT_I2C_DEV ?= i2c0
|
||||
EZCURRENT_I2C_DEV_LOWER=$(shell echo $(EZCURRENT_I2C_DEV) | tr A-Z a-z)
|
||||
EZCURRENT_I2C_DEV_UPPER=$(shell echo $(EZCURRENT_I2C_DEV) | tr a-z A-Z)
|
||||
</raw>
|
||||
<configure name="EZCURRENT_I2C_DEV" value="i2c0" default="TRUE" case="upper|lower"/>
|
||||
<define name="USE_$(EZCURRENT_I2C_DEV_UPPER)"/>
|
||||
<define name="EZCURRENT_I2C_DEV" value="$(EZCURRENT_I2C_DEV_LOWER)"/>
|
||||
<file name="ezcurrent.c"/>
|
||||
|
||||
@@ -16,11 +16,7 @@
|
||||
<periodic fun="generic_com_periodic()" period="180" start="start_com()" stop="stop_com()" autorun="TRUE"/>
|
||||
<event fun="generic_com_event()"/>
|
||||
<makefile>
|
||||
<raw>
|
||||
GENERIC_COM_I2C_DEV ?= i2c0
|
||||
GENERIC_COM_I2C_DEV_LOWER=$(shell echo $(GENERIC_COM_I2C_DEV) | tr A-Z a-z)
|
||||
GENERIC_COM_I2C_DEV_UPPER=$(shell echo $(GENERIC_COM_I2C_DEV) | tr a-z A-Z)
|
||||
</raw>
|
||||
<configure name="GENERIC_COM_I2C_DEV" value="i2c0" default="TRUE" case="upper|lower"/>
|
||||
<define name="USE_$(GENERIC_COM_I2C_DEV_UPPER)"/>
|
||||
<define name="GENERIC_COM_I2C_DEV" value="$(GENERIC_COM_I2C_DEV_LOWER)"/>
|
||||
<file name="generic_com.c"/>
|
||||
|
||||
@@ -21,15 +21,14 @@
|
||||
<file name="gps.c" dir="subsystems"/>
|
||||
<file name="gps_ubx.c" dir="subsystems/gps"/>
|
||||
<define name="USE_GPS"/>
|
||||
<configure name="GPS_PORT" case="upper|lower"/>
|
||||
<define name="USE_$(GPS_PORT_UPPER)"/>
|
||||
<define name="GPS_LINK" value="$(GPS_PORT_LOWER)"/>
|
||||
<define name="$(GPS_PORT_UPPER)_BAUD" value="$(GPS_BAUD)"/>
|
||||
<configure name="GPS_LED" value="none" default="TRUE"/>
|
||||
<define name="GPS_LED" value="$(GPS_LED)" cond="ifneq ($(GPS_LED),none)"/>
|
||||
<raw>
|
||||
UBX_GPS_PORT_LOWER=$(shell echo $(GPS_PORT) | tr A-Z a-z)
|
||||
ap.CFLAGS += -DGPS_TYPE_H=\"subsystems/gps/gps_ubx.h\"
|
||||
ap.CFLAGS += -DUSE_$(GPS_PORT) -D$(GPS_PORT)_BAUD=$(GPS_BAUD)
|
||||
ap.CFLAGS += -DUSE_GPS -DGPS_LINK=$(UBX_GPS_PORT_LOWER)
|
||||
GPS_LED ?= none
|
||||
ifneq ($(GPS_LED),none)
|
||||
ap.CFLAGS += -DGPS_LED=$(GPS_LED)
|
||||
endif
|
||||
</raw>
|
||||
</makefile>
|
||||
<makefile target="nps">
|
||||
|
||||
@@ -25,18 +25,11 @@
|
||||
|
||||
<makefile target="ap">
|
||||
<file name="hott.c"/>
|
||||
|
||||
<raw>
|
||||
HOTT_PORT ?= UART1
|
||||
HOTT_PORT_LOWER=$(shell echo $(HOTT_PORT) | tr A-Z a-z)
|
||||
HOTT_PORT_UPPER=$(shell echo $(HOTT_PORT) | tr a-z A-Z)
|
||||
|
||||
HOTT_SIM_EAM_SENSOR ?= 1
|
||||
HOTT_SIM_GAM_SENSOR ?= 0
|
||||
HOTT_SIM_GPS_SENSOR ?= 0
|
||||
HOTT_SIM_VARIO_SENSOR ?= 0
|
||||
</raw>
|
||||
|
||||
<configure name="HOTT_PORT" value="uart1" default="TRUE" case="upper|lower"/>
|
||||
<configure name="HOTT_SIM_EAM_SENSOR" value="1" default="TRUE"/>
|
||||
<configure name="HOTT_SIM_GAM_SENSOR" value="0" default="TRUE"/>
|
||||
<configure name="HOTT_SIM_GPS_SENSOR" value="0" default="TRUE"/>
|
||||
<configure name="HOTT_SIM_VARIO_SENSOR" value="0" default="TRUE"/>
|
||||
<define name="HOTT_PORT" value="$(HOTT_PORT_LOWER)"/>
|
||||
<define name="USE_$(HOTT_PORT_UPPER)"/>
|
||||
<define name="$(HOTT_PORT_UPPER)_BAUD" value="B19200"/>
|
||||
@@ -44,7 +37,6 @@
|
||||
<define name="HOTT_SIM_GAM_SENSOR" value="$(HOTT_SIM_GAM_SENSOR)"/>
|
||||
<define name="HOTT_SIM_GPS_SENSOR" value="$(HOTT_SIM_GPS_SENSOR)"/>
|
||||
<define name="HOTT_SIM_VARIO_SENSOR" value="$(HOTT_SIM_VARIO_SENSOR)"/>
|
||||
|
||||
</makefile>
|
||||
</module>
|
||||
|
||||
|
||||
@@ -13,11 +13,7 @@
|
||||
<periodic fun="humid_htm_read()" freq="4" delay="14"/>
|
||||
<event fun="humid_htm_event()"/>
|
||||
<makefile target="ap">
|
||||
<raw>
|
||||
HTM_I2C_DEV ?= i2c0
|
||||
HTM_I2C_DEV_LOWER=$(shell echo $(HTM_I2C_DEV) | tr A-Z a-z)
|
||||
HTM_I2C_DEV_UPPER=$(shell echo $(HTM_I2C_DEV) | tr a-z A-Z)
|
||||
</raw>
|
||||
<configure name="HTM_I2C_DEV" value="i2c0" default="TRUE" case="upper|lower"/>
|
||||
<define name="USE_$(HTM_I2C_DEV_UPPER)"/>
|
||||
<define name="HTM_I2C_DEV" value="$(HTM_I2C_DEV_LOWER)"/>
|
||||
<file name="humid_htm_b71.c"/>
|
||||
|
||||
@@ -17,11 +17,7 @@
|
||||
<periodic fun="imu_mpu9250_report()" freq="10" autorun="TRUE"/>
|
||||
<event fun="imu_mpu9250_event()"/>
|
||||
<makefile>
|
||||
<raw>
|
||||
IMU_MPU9250_I2C_DEV ?= i2c1
|
||||
IMU_MPU9250_I2C_DEV_LOWER=$(shell echo $(IMU_MPU9250_I2C_DEV) | tr A-Z a-z)
|
||||
IMU_MPU9250_I2C_DEV_UPPER=$(shell echo $(IMU_MPU9250_I2C_DEV) | tr a-z A-Z)
|
||||
</raw>
|
||||
<configure name="IMU_MPU9250_I2C_DEV" value="i2c1" default="TRUE" case="upper|lower"/>
|
||||
<define name="USE_$(IMU_MPU9250_I2C_DEV_UPPER)"/>
|
||||
<define name="IMU_MPU9250_I2C_DEV" value="$(IMU_MPU9250_I2C_DEV_LOWER)"/>
|
||||
<file name="imu_mpu9250.c"/>
|
||||
|
||||
@@ -15,15 +15,9 @@
|
||||
<periodic fun="vn100_report_task()" freq="4"/>
|
||||
<event fun="vn100_event_task()"/>
|
||||
<makefile>
|
||||
<configure name="VN100_SPI_DEV" value="spi1" default="TRUE" case="upper|lower"/>
|
||||
<configure name="VN100_SLAVE_IDX" value="spi_slave0" default="TRUE" case="upper|lower"/>
|
||||
<raw>
|
||||
VN100_SPI_DEV ?= spi1
|
||||
VN100_SPI_DEV_LOWER=$(shell echo $(VN100_SPI_DEV) | tr A-Z a-z)
|
||||
VN100_SPI_DEV_UPPER=$(shell echo $(VN100_SPI_DEV) | tr a-z A-Z)
|
||||
|
||||
VN100_SLAVE_IDX ?= spi_slave0
|
||||
VN100_SLAVE_IDX_LOWER=$(shell echo $(VN100_SLAVE_IDX) | tr A-Z a-z)
|
||||
VN100_SLAVE_IDX_UPPER=$(shell echo $(VN100_SLAVE_IDX) | tr a-z A-Z)
|
||||
|
||||
include $(CFG_SHARED)/spi_master.makefile
|
||||
</raw>
|
||||
<define name="USE_$(VN100_SPI_DEV_UPPER)" />
|
||||
|
||||
@@ -39,19 +39,9 @@ For more informations on how to use this module you can refer to the wiki : http
|
||||
<periodic fun="high_speed_logger_direct_memory_periodic()" autorun="TRUE"/>
|
||||
<makefile>
|
||||
|
||||
<raw>
|
||||
HS_LOG_UART ?= uart3
|
||||
HS_LOG_UART_LOWER=$(shell echo $(HS_LOG_UART) | tr A-Z a-z)
|
||||
HS_LOG_UART_UPPER=$(shell echo $(HS_LOG_UART) | tr a-z A-Z)
|
||||
|
||||
HS_LOG_SPI ?= spi1
|
||||
HS_LOG_SPI_LOWER=$(shell echo $(HS_LOG_SPI) | tr A-Z a-z)
|
||||
HS_LOG_SPI_UPPER=$(shell echo $(HS_LOG_SPI) | tr a-z A-Z)
|
||||
|
||||
HS_LOG_SPI_SLAVE ?= spi_slave1
|
||||
HS_LOG_SPI_SLAVE_LOWER=$(shell echo $(HS_LOG_SPI_SLAVE) | tr A-Z a-z)
|
||||
HS_LOG_SPI_SLAVE_UPPER=$(shell echo $(HS_LOG_SPI_SLAVE) | tr a-z A-Z)
|
||||
</raw>
|
||||
<configure name="HS_LOG_UART" value="uart3" default="TRUE" case="upper|lower"/>
|
||||
<configure name="HS_LOG_SPI" value="spi1" default="TRUE" case="upper|lower"/>
|
||||
<configure name="HS_LOG_SPI_SLAVE" value="spi_slave1" default="TRUE" case="upper|lower"/>
|
||||
|
||||
<define name="SPI_MASTER" value="1" />
|
||||
<define name="USE_$(HS_LOG_SPI_UPPER)" value="1" />
|
||||
|
||||
@@ -38,22 +38,12 @@ Do not use start/stop functionality of the module, the module is not intended to
|
||||
<datalink message="SETTING" fun="sdlogger_spi_direct_command()"/>
|
||||
<makefile target="ap">
|
||||
|
||||
<configure name="SDLOGGER_DIRECT_SPI" value="spi2" default="TRUE" case="upper|lower"/>
|
||||
<configure name="SDLOGGER_DIRECT_SPI_SLAVE" value="spi_slave2" default="TRUE" case="upper|lower"/>
|
||||
<configure name="SDLOGGER_DIRECT_CONTROL_SWITCH" value="RADIO_AUX2" default="TRUE"/>
|
||||
<configure name="LOGGER_LED" value="none" default="TRUE"/>
|
||||
<define name="LOGGER_LED" value="$(LOGGER_LED)" cond="ifneq ($(LOGGER_LED),none)"/>
|
||||
<raw>
|
||||
SDLOGGER_DIRECT_SPI ?= spi2
|
||||
SDLOGGER_DIRECT_SPI_LOWER=$(shell echo $(SDLOGGER_DIRECT_SPI) | tr A-Z a-z)
|
||||
SDLOGGER_DIRECT_SPI_UPPER=$(shell echo $(SDLOGGER_DIRECT_SPI) | tr a-z A-Z)
|
||||
|
||||
SDLOGGER_DIRECT_SPI_SLAVE ?= spi_slave2
|
||||
SDLOGGER_DIRECT_SPI_SLAVE_LOWER=$(shell echo $(SDLOGGER_DIRECT_SPI_SLAVE) | tr A-Z a-z)
|
||||
SDLOGGER_DIRECT_SPI_SLAVE_UPPER=$(shell echo $(SDLOGGER_DIRECT_SPI_SLAVE) | tr a-z A-Z)
|
||||
|
||||
SDLOGGER_DIRECT_CONTROL_SWITCH ?= RADIO_AUX2
|
||||
|
||||
LOGGER_LED ?= none
|
||||
ifneq ($(LOGGER_LED),none)
|
||||
ap.CFLAGS += -DLOGGER_LED=$(LOGGER_LED)
|
||||
endif
|
||||
|
||||
include $(CFG_SHARED)/sdlog.makefile
|
||||
include $(CFG_SHARED)/spi_master.makefile
|
||||
</raw>
|
||||
|
||||
@@ -12,15 +12,9 @@
|
||||
<init fun="high_speed_logger_spi_link_init()"/>
|
||||
<periodic fun="high_speed_logger_spi_link_periodic()" autorun="TRUE"/>
|
||||
<makefile target="ap">
|
||||
<configure name="HS_LOG_SPI_DEV" value="spi1" default="TRUE" case="upper|lower"/>
|
||||
<configure name="HS_LOG_SPI_SLAVE_IDX" value="spi_slave1" default="TRUE" case="upper|lower"/>
|
||||
<raw>
|
||||
HS_LOG_SPI_DEV ?= spi1
|
||||
HS_LOG_SPI_DEV_LOWER=$(shell echo $(HS_LOG_SPI_DEV) | tr A-Z a-z)
|
||||
HS_LOG_SPI_DEV_UPPER=$(shell echo $(HS_LOG_SPI_DEV) | tr a-z A-Z)
|
||||
|
||||
HS_LOG_SPI_SLAVE_IDX ?= spi_slave1
|
||||
HS_LOG_SPI_SLAVE_IDX_LOWER=$(shell echo $(HS_LOG_SPI_SLAVE_IDX) | tr A-Z a-z)
|
||||
HS_LOG_SPI_SLAVE_IDX_UPPER=$(shell echo $(HS_LOG_SPI_SLAVE_IDX) | tr a-z A-Z)
|
||||
|
||||
include $(CFG_SHARED)/spi_master.makefile
|
||||
</raw>
|
||||
|
||||
|
||||
@@ -12,11 +12,7 @@
|
||||
<periodic fun="hmc5843_module_periodic()" freq="60"/>
|
||||
<event fun="hmc5843_module_event()"/>
|
||||
<makefile>
|
||||
<raw>
|
||||
HMC5843_I2C_DEV ?= i2c0
|
||||
HMC5843_I2C_DEV_LOWER=$(shell echo $(HMC5843_I2C_DEV) | tr A-Z a-z)
|
||||
HMC5843_I2C_DEV_UPPER=$(shell echo $(HMC5843_I2C_DEV) | tr a-z A-Z)
|
||||
</raw>
|
||||
<configure name="HMC5843_I2C_DEV" value="i2c0" default="TRUE" case="upper|lower"/>
|
||||
<define name="USE_$(HMC5843_I2C_DEV_UPPER)"/>
|
||||
<define name="HMC5843_I2C_DEV" value="$(HMC5843_I2C_DEV_LOWER)"/>
|
||||
<file name="mag_hmc5843.c"/>
|
||||
|
||||
@@ -25,9 +25,8 @@
|
||||
ifeq ($(MAG_HMC58XX_I2C_DEV),)
|
||||
$(error mag_hmc58xx module error: please configure MAG_HMC58XX_I2C_DEV)
|
||||
endif
|
||||
MAG_HMC58XX_I2C_DEV_UPPER=$(shell echo $(MAG_HMC58XX_I2C_DEV) | tr a-z A-Z)
|
||||
MAG_HMC58XX_I2C_DEV_LOWER=$(shell echo $(MAG_HMC58XX_I2C_DEV) | tr A-Z a-z)
|
||||
</raw>
|
||||
<configure name="MAG_HMC58XX_I2C_DEV" default="TRUE" case="upper|lower"/>
|
||||
<define name="USE_$(MAG_HMC58XX_I2C_DEV_UPPER)"/>
|
||||
<define name="MAG_HMC58XX_I2C_DEV" value="$(MAG_HMC58XX_I2C_DEV_LOWER)"/>
|
||||
</makefile>
|
||||
|
||||
@@ -20,10 +20,8 @@
|
||||
<file name="mission_manager.c" dir="modules/datalink/missionlib"/>
|
||||
<file name="waypoints.c" dir="modules/datalink/missionlib"/>
|
||||
<file name="blocks.c" dir="modules/datalink/missionlib"/>
|
||||
<configure name="MAVLINK_PORT" value="uart1" default="TRUE" case="upper|lower"/>
|
||||
<raw>
|
||||
MAVLINK_PORT ?= UART1
|
||||
MAVLINK_PORT_UPPER=$(shell echo $(MAVLINK_PORT) | tr a-z A-Z)
|
||||
MAVLINK_PORT_LOWER=$(shell echo $(MAVLINK_PORT) | tr A-Z a-z)
|
||||
ifneq (,$(findstring usb,$(MAVLINK_PORT_LOWER)))
|
||||
ap.CFLAGS += -DUSE_USB_SERIAL
|
||||
ap.srcs += $(SRC_ARCH)/usb_ser_hw.c
|
||||
|
||||
@@ -11,12 +11,10 @@
|
||||
</header>
|
||||
<event fun="MavlinkDatalinkEvent()"/>
|
||||
<makefile>
|
||||
<raw>
|
||||
MAVLINK_PORT_LOWER=$(shell echo $(MAVLINK_PORT) | tr A-Z a-z)
|
||||
</raw>
|
||||
<configure name="MAVLINK_PORT" case="upper|lower"/>
|
||||
<define name="MAVLINK_UART" value="$(MAVLINK_PORT_LOWER)"/>
|
||||
<define name="USE_$(MAVLINK_PORT)"/>
|
||||
<define name="$(MAVLINK_PORT)_BAUD" value="$(MAVLINK_BAUD)"/>
|
||||
<define name="USE_$(MAVLINK_PORT_UPPER)"/>
|
||||
<define name="$(MAVLINK_PORT_UPPER)_BAUD" value="$(MAVLINK_BAUD)"/>
|
||||
<file name="mavlink_decoder.c"/>
|
||||
</makefile>
|
||||
</module>
|
||||
|
||||
@@ -52,10 +52,7 @@
|
||||
<periodic fun="meteo_stick_periodic()" freq="10" autorun="TRUE"/>
|
||||
<event fun="meteo_stick_event()"/>
|
||||
<makefile target="ap">
|
||||
<raw>
|
||||
MS_SPI_DEV_UPPER=$(shell echo $(MS_SPI_DEV) | tr a-z A-Z)
|
||||
MS_SPI_DEV_LOWER=$(shell echo $(MS_SPI_DEV) | tr A-Z a-z)
|
||||
</raw>
|
||||
<configure name="MS_SPI_DEV" case="upper|lower"/>
|
||||
<file name="meteo_stick.c"/>
|
||||
<file name="meteo_stick_calib.c"/>
|
||||
<file name="ads1220.c" dir="peripherals"/>
|
||||
|
||||
@@ -63,7 +63,9 @@ prefix CDATA #IMPLIED>
|
||||
|
||||
<!ATTLIST configure
|
||||
name CDATA #REQUIRED
|
||||
value CDATA #REQUIRED
|
||||
value CDATA #IMPLIED
|
||||
case CDATA #IMPLIED
|
||||
default CDATA #IMPLIED
|
||||
description CDATA #IMPLIED>
|
||||
|
||||
<!ATTLIST define
|
||||
|
||||
@@ -13,15 +13,9 @@
|
||||
<periodic fun="max7456_periodic()" freq="20" autorun="TRUE"/>
|
||||
<event fun="max7456_event()"/>
|
||||
<makefile target="ap">
|
||||
<configure name="MAX7456_SPI_DEV" value="spi2" default="TRUE" case="upper|lower"/>
|
||||
<configure name="MAX7456_SLAVE_IDX" value="spi_slave2" default="TRUE" case="upper|lower"/>
|
||||
<raw>
|
||||
MAX7456_SPI_DEV ?= spi2
|
||||
MAX7456_SPI_DEV_LOWER=$(shell echo $(MAX7456_SPI_DEV) | tr A-Z a-z)
|
||||
MAX7456_SPI_DEV_UPPER=$(shell echo $(MAX7456_SPI_DEV) | tr a-z A-Z)
|
||||
|
||||
MAX7456_SLAVE_IDX ?= spi_slave2
|
||||
MAX7456_SLAVE_IDX_LOWER=$(shell echo $(MAX7456_SLAVE_IDX) | tr A-Z a-z)
|
||||
MAX7456_SLAVE_IDX_UPPER=$(shell echo $(MAX7456_SLAVE_IDX) | tr a-z A-Z)
|
||||
|
||||
include $(CFG_SHARED)/spi_master.makefile
|
||||
</raw>
|
||||
<define name="USE_$(MAX7456_SPI_DEV_UPPER)" />
|
||||
|
||||
@@ -20,10 +20,7 @@
|
||||
<periodic fun="stereocam_periodic()" start="stereocam_start()" stop="stereocam_stop()" autorun="TRUE" freq="512"/>
|
||||
<makefile>
|
||||
<file name="stereoprotocol.c" dir="modules/stereocam"/>
|
||||
<raw>
|
||||
STEREO_UART_LOWER=$(shell echo $(STEREO_UART) | tr A-Z a-z)
|
||||
STEREO_UART_UPPER=$(shell echo $(STEREO_UART) | tr a-z A-Z)
|
||||
</raw>
|
||||
<configure name="STEREO_UART" case="upper|lower"/>
|
||||
<define name="USE_$(STEREO_UART_UPPER)"/>
|
||||
<define name="UART_LINK" value="$(STEREO_UART_LOWER)"/>
|
||||
<define name="$(STEREO_UART_UPPER)_BAUD" value="$(STEREO_BAUD)"/>
|
||||
|
||||
@@ -11,15 +11,12 @@
|
||||
<periodic fun="stereocam_droplet_periodic()" freq="20" autorun="TRUE"/>
|
||||
<makefile target="ap">
|
||||
<file name="droplet/stereocam_droplet.c"/>
|
||||
<raw>
|
||||
STEREO_UART ?= UART1
|
||||
STEREO_BAUD ?= B9600
|
||||
STEREO_LED ?= 3
|
||||
STEREO_UART_LOWER=$(shell echo $(STEREO_UART) | tr A-Z a-z)
|
||||
</raw>
|
||||
<define name="USE_$(STEREO_UART)"/>
|
||||
<configure name="STEREO_UART" value="uart1" default="TRUE" case="upper|lower"/>
|
||||
<configure name="STEREO_BAUD" value="B9600" default="TRUE"/>
|
||||
<configure name="STEREO_LED" value="3" default="TRUE"/>
|
||||
<define name="USE_$(STEREO_UART_UPPER)"/>
|
||||
<define name="STEREO_UART" value="$(STEREO_UART_LOWER)"/>
|
||||
<define name="$(STEREO_UART)_BAUD" value="$(STEREO_BAUD)"/>
|
||||
<define name="$(STEREO_UART_UPPER)_BAUD" value="$(STEREO_BAUD)"/>
|
||||
</makefile>
|
||||
</module>
|
||||
|
||||
|
||||
@@ -14,15 +14,12 @@
|
||||
<periodic fun="stereo_avoid_run()" freq="20" autorun="TRUE"/>
|
||||
|
||||
<makefile>
|
||||
<raw>
|
||||
STEREO_UART ?= UART1
|
||||
STEREO_BAUD ?= B9600
|
||||
STEREO_LED ?= 3
|
||||
STEREO_UART_LOWER=$(shell echo $(STEREO_UART) | tr A-Z a-z)
|
||||
</raw>
|
||||
<define name="USE_$(STEREO_UART)"/>
|
||||
<configure name="STEREO_UART" value="uart1" default="TRUE" case="upper|lower"/>
|
||||
<configure name="STEREO_BAUD" value="B9600" default="TRUE"/>
|
||||
<configure name="STEREO_LED" value="3" default="TRUE"/>
|
||||
<define name="USE_$(STEREO_UART_UPPER)"/>
|
||||
<define name="STEREO_UART" value="$(STEREO_UART_LOWER)"/>
|
||||
<define name="$(STEREO_UART)_BAUD" value="$(STEREO_BAUD)"/>
|
||||
<define name="$(STEREO_UART_UPPER)_BAUD" value="$(STEREO_BAUD)"/>
|
||||
<file name="nav_line_avoid/avoid_navigation.c"/>
|
||||
</makefile>
|
||||
<makefile target="ap">
|
||||
|
||||
@@ -17,12 +17,10 @@
|
||||
<makefile>
|
||||
<file name="state2camera/state2camera.c"/>
|
||||
<file name="stereoprotocol.c" dir="modules/stereocam"/>
|
||||
<raw>
|
||||
STEREO_UART_LOWER=$(shell echo $(STEREO_UART) | tr A-Z a-z)
|
||||
ap.CFLAGS += -DUSE_$(STEREO_UART)
|
||||
ap.CFLAGS += -DUART_LINK=$(STEREO_UART_LOWER)
|
||||
ap.CFLAGS += -D$(STEREO_UART)_BAUD=$(STEREO_BAUD)
|
||||
</raw>
|
||||
<configure name="STEREO_UART" case="upper|lower"/>
|
||||
<define name="USE_$(STEREO_UART_UPPER)"/>
|
||||
<define name="UART_LINK" value="$(STEREO_UART_LOWER)"/>
|
||||
<define name="$(STEREO_UART_UPPER)_BAUD" value="$(STEREO_BAUD)"/>
|
||||
</makefile>
|
||||
|
||||
</module>
|
||||
|
||||
@@ -14,11 +14,7 @@
|
||||
<periodic fun="temod_periodic()" freq="8"/>
|
||||
<event fun="temod_event()"/>
|
||||
<makefile target="ap">
|
||||
<raw>
|
||||
TEMOD_I2C_DEV ?= i2c0
|
||||
TEMOD_I2C_DEV_LOWER=$(shell echo $(TEMOD_I2C_DEV) | tr A-Z a-z)
|
||||
TEMOD_I2C_DEV_UPPER=$(shell echo $(TEMOD_I2C_DEV) | tr a-z A-Z)
|
||||
</raw>
|
||||
<configure name="TEMOD_I2C_DEV" value="i2c0" default="TRUE" case="upper|lower"/>
|
||||
<define name="USE_$(TEMOD_I2C_DEV_UPPER)"/>
|
||||
<define name="TEMOD_I2C_DEV" value="$(TEMOD_I2C_DEV_LOWER)"/>
|
||||
<file name="temp_temod.c"/>
|
||||
|
||||
@@ -9,12 +9,11 @@
|
||||
</header>
|
||||
<makefile>
|
||||
<file name="uart_drop.c"/>
|
||||
<raw>
|
||||
UART_DROP_PORT ?= UART1
|
||||
UART_DROP_BAUD ?= B115200
|
||||
UART_DROP_PORT_LOWER = $(shell echo $(UART_DROP_PORT) | tr A-Z a-z)
|
||||
ap.CFLAGS += -DUART_DROP_PORT=$(UART_DROP_PORT_LOWER) -DUSE_$(UART_DROP_PORT) -D$(UART_DROP_PORT)_BAUD=$(UART_DROP_BAUD)
|
||||
</raw>
|
||||
<configure name="UART_DROP_PORT" value="uart1" default="TRUE" case="upper|lower"/>
|
||||
<configure name="UART_DROP_BAUD" value="B115200" default="TRUE"/>
|
||||
<define name="UART_DROP_PORT" value="$(UART_DROP_PORT_LOWER)"/>
|
||||
<define name="USE_$(UART_DROP_PORT_UPPER)"/>
|
||||
<define name="$(UART_DROP_PORT_UPPER)_BAUD" value="$(UART_DROP_BAUD)"/>
|
||||
</makefile>
|
||||
</module>
|
||||
|
||||
|
||||
@@ -54,10 +54,22 @@ let check_unique_id_and_name = fun conf conf_xml ->
|
||||
Hashtbl.add names name id
|
||||
) conf
|
||||
|
||||
|
||||
let configure_xml2mk = fun f xml ->
|
||||
(* all makefiles variables are forced to uppercase *)
|
||||
let name = String.uppercase (ExtXml.attrib xml "name")
|
||||
and value = ExtXml.attrib xml "value" in
|
||||
fprintf f "%s = %s\n" name value
|
||||
and value = ExtXml.attrib_or_default xml "value" ""
|
||||
and default = if String.lowercase (ExtXml.attrib_or_default xml "default" "") = "true" then "?" else ""
|
||||
and case = ExtXml.attrib_or_default xml "case" "" in
|
||||
(* Only print variable if value is not empty *)
|
||||
if String.length value > 0 then
|
||||
fprintf f "%s =%s %s\n" name default value;
|
||||
(* also providing lower and upper case version on request *)
|
||||
if Str.string_match (Str.regexp ".*lower.*") case 0 then
|
||||
fprintf f "%s_LOWER = $(shell echo $(%s) | tr A-Z a-z)\n" name name;
|
||||
if Str.string_match (Str.regexp ".*upper.*") case 0 then
|
||||
fprintf f "%s_UPPER = $(shell echo $(%s) | tr a-z A-Z)\n" name name
|
||||
|
||||
|
||||
let define_xml2mk = fun f ?(target="$(TARGET)") ?(vpath=None) xml ->
|
||||
let name = Xml.attrib xml "name"
|
||||
|
||||
Reference in New Issue
Block a user