From c350bf6bcea28c96a366e2d17d288c8fb2b32401 Mon Sep 17 00:00:00 2001 From: Christophe De Wagter Date: Sun, 25 Jul 2010 16:30:28 +0000 Subject: [PATCH] Tiny Makefile using includes and SRC_DIR --- conf/airframes/AirborneCodeReorg/LisaFw.xml | 51 ++-------- conf/airframes/AirborneCodeReorg/TinyFw.xml | 58 +++++------ conf/autopilot/fixedwing_autopilot.makefile | 99 ++++--------------- conf/autopilot/lisa_l.makefile | 13 +++ .../fixedwing_actuators_4017.makefile | 5 + .../subsystems/fixedwing_gps_ublox.makefile | 13 +++ .../fixedwing_telemetry_transparent.makefile | 15 +++ .../fixedwing_telemetry_xbee24.makefile | 5 + 8 files changed, 99 insertions(+), 160 deletions(-) create mode 100644 conf/autopilot/lisa_l.makefile create mode 100644 conf/autopilot/subsystems/fixedwing_actuators_4017.makefile create mode 100644 conf/autopilot/subsystems/fixedwing_gps_ublox.makefile create mode 100644 conf/autopilot/subsystems/fixedwing_telemetry_transparent.makefile create mode 100644 conf/autopilot/subsystems/fixedwing_telemetry_xbee24.makefile diff --git a/conf/airframes/AirborneCodeReorg/LisaFw.xml b/conf/airframes/AirborneCodeReorg/LisaFw.xml index 7d641e7fc5..67f5bdd636 100644 --- a/conf/airframes/AirborneCodeReorg/LisaFw.xml +++ b/conf/airframes/AirborneCodeReorg/LisaFw.xml @@ -170,54 +170,17 @@ -ARCH=stm32 -ARCHI=stm32 -SRC_ARCH=$(ARCH) -BOARD_CFG=\"boards/lisa_0.99.h\" -FLASH_MODE = JTAG +# Config for AP + +include $(PAPARAZZI_SRC)/conf/autopilot/lisa_l.makefile include $(PAPARAZZI_SRC)/conf/autopilot/fixedwing_common.makefile include $(CFG_FIXEDWING)/fixedwing_autopilot.makefile -# FLASH_MODE=IAP - -# ap.CFLAGS += -DFBW -DAP -DLED -DTIME_LED=1 -# ap.srcs = sys_time.c $(SRC_ARCH)/sys_time_hw.c $(SRC_ARCH)/armVIC.c main_fbw.c main_ap.c - - -# ap.srcs += commands.c - -# ap.CFLAGS += -DACTUATORS=\"servos_4017_hw.h\" -DSERVOS_4017 -# ap.srcs += $(SRC_ARCH)/servos_4017_hw.c actuators.c - -# ap.CFLAGS += -DRADIO_CONTROL -# ap.srcs += radio_control.c $(SRC_ARCH)/ppm_hw.c - -# ap.CFLAGS += -DDOWNLINK -DUSE_UART1 -DDOWNLINK_TRANSPORT=PprzTransport -DDOWNLINK_FBW_DEVICE=Uart1 -DDOWNLINK_AP_DEVICE=Uart1 -DPPRZ_UART=Uart1 -DDATALINK=PPRZ -DUART1_BAUD=B9600 -# ap.srcs += downlink.c $(SRC_ARCH)/uart_hw.c datalink.c pprz_transport.c - -# ap.CFLAGS += -DINTER_MCU -# ap.srcs += inter_mcu.c - -# ap.CFLAGS += -DADC -DUSE_ADC_0 -DUSE_ADC_1 -DUSE_ADC_2 -DUSE_ADC_3 -# ap.srcs += $(SRC_ARCH)/adc_hw.c - -# ap.CFLAGS += -DGPS -DUBX -DUSE_UART0 -DGPS_LINK=Uart0 -DUART0_BAUD=B38400 -# ap.srcs += gps_ubx.c gps.c latlong.c - -# ap.CFLAGS += -DINFRARED -DALT_KALMAN -# ap.srcs += infrared.c estimator.c - -# ap.CFLAGS += -DNAV -DAGR_CLIMB -DLOITER_TRIM -# ap.srcs += nav.c fw_h_ctl.c fw_v_ctl.c - -# ap.CFLAGS += -DGYRO -DADXRS150 -# ap.srcs += gyro.c -# ap.srcs += nav_line.c nav_survey_rectangle.c - # Config for SITL simulation -# include $(PAPARAZZI_SRC)/conf/autopilot/sitl.makefile -# sim.CFLAGS += -DBOARD_CONFIG=\"tiny.h\" -DAGR_CLIMB -DLOITER_TRIM -DALT_KALMAN -DTRAFFIC_INFO -# sim.srcs += nav_survey_rectangle.c traffic_info.c nav_line.c + +include $(PAPARAZZI_SRC)/conf/autopilot/sitl.makefile +sim.CFLAGS += -DBOARD_CONFIG=\"tiny.h\" -DAGR_CLIMB -DLOITER_TRIM -DALT_KALMAN -DTRAFFIC_INFO +sim.srcs += nav_survey_rectangle.c traffic_info.c nav_line.c diff --git a/conf/airframes/AirborneCodeReorg/TinyFw.xml b/conf/airframes/AirborneCodeReorg/TinyFw.xml index 4b89a687bb..fc85a64b34 100644 --- a/conf/airframes/AirborneCodeReorg/TinyFw.xml +++ b/conf/airframes/AirborneCodeReorg/TinyFw.xml @@ -170,54 +170,42 @@ -ARCH=arm7 -ARCHI=arm7 -SRC_ARCH=$(ARCH) -BOARD_CFG=\"tiny2_1_1.h\" -FLASH_MODE = JTAG +BOARD_CFG=\"tiny_2_1_1.h\" +FLASH_MODE=IAP + +include $(PAPARAZZI_SRC)/conf/autopilot/tiny.makefile include $(PAPARAZZI_SRC)/conf/autopilot/fixedwing_common.makefile include $(CFG_FIXEDWING)/fixedwing_autopilot.makefile -# FLASH_MODE=IAP +GPS_UART=Uart0 +GPS_BAUD=38400 +include $(CFG_FIXEDWING)/subsystems/fixedwing_gps_ublox.makefile -# ap.CFLAGS += -DFBW -DAP -DLED -DTIME_LED=1 -# ap.srcs = sys_time.c $(SRC_ARCH)/sys_time_hw.c $(SRC_ARCH)/armVIC.c main_fbw.c main_ap.c +MODEM_UART=Uart1 +MODEM_BAUD=9600 +include $(CFG_FIXEDWING)/subsystems/fixedwing_telemetry_transparent.makefile -# ap.srcs += commands.c +ap.CFLAGS += -DRADIO_CONTROL +ap.srcs += radio_control.c $(SRC_ARCH)/ppm_hw.c -# ap.CFLAGS += -DACTUATORS=\"servos_4017_hw.h\" -DSERVOS_4017 -# ap.srcs += $(SRC_ARCH)/servos_4017_hw.c actuators.c -# ap.CFLAGS += -DRADIO_CONTROL -# ap.srcs += radio_control.c $(SRC_ARCH)/ppm_hw.c +ap.CFLAGS += -DUSE_ADC_0 -DUSE_ADC_1 -DUSE_ADC_2 -DUSE_ADC_3 -# ap.CFLAGS += -DDOWNLINK -DUSE_UART1 -DDOWNLINK_TRANSPORT=PprzTransport -DDOWNLINK_FBW_DEVICE=Uart1 -DDOWNLINK_AP_DEVICE=Uart1 -DPPRZ_UART=Uart1 -DDATALINK=PPRZ -DUART1_BAUD=B9600 -# ap.srcs += downlink.c $(SRC_ARCH)/uart_hw.c datalink.c pprz_transport.c +ap.CFLAGS += -DINFRARED -DALT_KALMAN +ap.srcs += infrared.c -# ap.CFLAGS += -DINTER_MCU -# ap.srcs += inter_mcu.c +ap.CFLAGS += -DNAV -DAGR_CLIMB -DLOITER_TRIM +ap.srcs += nav.c fw_h_ctl.c fw_v_ctl.c -# ap.CFLAGS += -DADC -DUSE_ADC_0 -DUSE_ADC_1 -DUSE_ADC_2 -DUSE_ADC_3 -# ap.srcs += $(SRC_ARCH)/adc_hw.c - -# ap.CFLAGS += -DGPS -DUBX -DUSE_UART0 -DGPS_LINK=Uart0 -DUART0_BAUD=B38400 -# ap.srcs += gps_ubx.c gps.c latlong.c - -# ap.CFLAGS += -DINFRARED -DALT_KALMAN -# ap.srcs += infrared.c estimator.c - -# ap.CFLAGS += -DNAV -DAGR_CLIMB -DLOITER_TRIM -# ap.srcs += nav.c fw_h_ctl.c fw_v_ctl.c - -# ap.CFLAGS += -DGYRO -DADXRS150 -# ap.srcs += gyro.c -# ap.srcs += nav_line.c nav_survey_rectangle.c +ap.CFLAGS += -DGYRO -DADXRS150 +ap.srcs += gyro.c +ap.srcs += nav_line.c nav_survey_rectangle.c # Config for SITL simulation -# include $(PAPARAZZI_SRC)/conf/autopilot/sitl.makefile -# sim.CFLAGS += -DBOARD_CONFIG=\"tiny.h\" -DAGR_CLIMB -DLOITER_TRIM -DALT_KALMAN -DTRAFFIC_INFO -# sim.srcs += nav_survey_rectangle.c traffic_info.c nav_line.c +include $(PAPARAZZI_SRC)/conf/autopilot/sitl.makefile +sim.CFLAGS += -DBOARD_CONFIG=\"tiny.h\" -DAGR_CLIMB -DLOITER_TRIM -DALT_KALMAN -DTRAFFIC_INFO +sim.srcs += nav_survey_rectangle.c traffic_info.c nav_line.c diff --git a/conf/autopilot/fixedwing_autopilot.makefile b/conf/autopilot/fixedwing_autopilot.makefile index afed003b5b..f1c8b51638 100644 --- a/conf/autopilot/fixedwing_autopilot.makefile +++ b/conf/autopilot/fixedwing_autopilot.makefile @@ -50,7 +50,7 @@ endif # # LEDs # -ap.CFLAGS += -DUSE_LED +ap.CFLAGS += -DUSE_LED -DLED -DTIME_LED=1 ifeq ($(ARCHI), stm32) ap.srcs += $(SRC_ARCH)/led_hw.c endif @@ -66,76 +66,38 @@ ap.CFLAGS += -DSYS_TIME_LED=1 endif # -# FlyByWire +# FlyByWire Main # ap.CFLAGS += -DFBW ap.srcs += $(SRC_FIXEDWING)/main_fbw.c # -# Telemetry/Datalink +# AutoPilot Main # -# ap.srcs += $(SRC_ARCH)/uart_hw.c -# ap.CFLAGS += -DDOWNLINK -DDOWNLINK_TRANSPORT=PprzTransport -# ap.srcs += $(SRC_FIXEDWING)/booz2_telemetry.c \ -# downlink.c \ -# pprz_transport.c -# ap.CFLAGS += -DDATALINK=PPRZ -# ap.srcs += $(SRC_FIXEDWING)/booz2_datalink.c - -# ifeq ($(ARCHI), arm7) -# ap.CFLAGS += -DUSE_UART1 -DUART1_VIC_SLOT=6 -DUART1_BAUD=MODEM_BAUD -# ap.CFLAGS += -DDOWNLINK_DEVICE=Uart1 -# ap.CFLAGS += -DPPRZ_UART=Uart1 -# else ifeq ($(ARCHI), stm32) -# ap.CFLAGS += -DUSE_UART2 -DUART2_BAUD=MODEM_BAUD -# ap.CFLAGS += -DDOWNLINK_DEVICE=Uart2 -# ap.CFLAGS += -DPPRZ_UART=Uart2 -# endif - - -# ap.srcs += $(SRC_FIXEDWING)/booz2_commands.c +ap.CFLAGS += -DAP +ap.srcs += $(SRC_FIXEDWING)/main_ap.c +ap.srcs += $(SRC_FIXEDWING)/estimator.c # -# Radio control choice -# -# include booz2_radio_control_ppm.makefile -# or -# include booz2_radio_control_spektrum.makefile +# InterMCU Commands # -# -# Actuator choice -# -# include booz2_actuators_buss.makefile -# or -# include booz2_actuators_asctec.makefile -# +ap.CFLAGS += -DINTER_MCU +ap.srcs += $(SRC_FIXEDWING)/inter_mcu.c +ap.srcs += $(SRC_FIXEDWING)/commands.c # -# IMU choice -# -# include booz2_imu_b2v1.makefile -# or -# include booz2_imu_b2v1_1.makefile -# or -# include booz2_imu_crista.makefile +# UARTS # +ap.srcs += $(SRC_ARCH)/uart_hw.c -# ifeq ($(ARCHI), arm7) -# ap.CFLAGS += -DBOOZ2_ANALOG_BARO_LED=2 -DBOOZ2_ANALOG_BARO_PERIOD='SYS_TICS_OF_SEC((1./100.))' -# ap.srcs += $(SRC_FIXEDWING)/booz2_analog_baro.c -# -# ap.CFLAGS += -DBOOZ2_ANALOG_BATTERY_PERIOD='SYS_TICS_OF_SEC((1./10.))' -# ap.srcs += $(SRC_FIXEDWING)/booz2_battery.c -# -# ap.CFLAGS += -DADC0_VIC_SLOT=2 -# ap.CFLAGS += -DADC1_VIC_SLOT=3 -# ap.srcs += $(SRC_FIXEDWING)/booz2_analog.c \ -# $(SRC_FIXEDWING_ARCH)/booz2_analog_hw.c -# else ifeq ($(ARCHI), stm32) -# ap.srcs += lisa/lisa_analog_plug.c -# endif +ifeq ($(ARCHI), arm7) +ap.CFLAGS += -DADC +ap.srcs += $(SRC_ARCH)/adc_hw.c +else ifeq ($(ARCHI), stm32) +ap.srcs += lisa/lisa_analog_plug.c +endif # @@ -155,25 +117,6 @@ ap.srcs += $(SRC_FIXEDWING)/main_fbw.c # include booz2_ahrs_lkf.makefile # -# ap.srcs += $(SRC_FIXEDWING)/booz2_autopilot.c - -# ap.srcs += math/pprz_trig_int.c -# ap.srcs += $(SRC_FIXEDWING)/booz_stabilization.c -# ap.srcs += $(SRC_FIXEDWING)/stabilization/booz_stabilization_rate.c - - -# ap.CFLAGS += -DSTABILISATION_ATTITUDE_TYPE_INT -# ap.CFLAGS += -DSTABILISATION_ATTITUDE_H=\"stabilization/booz_stabilization_attitude_int.h\" -# ap.CFLAGS += -DSTABILISATION_ATTITUDE_REF_H=\"stabilization/booz_stabilization_attitude_ref_euler_int.h\" -# ap.srcs += $(SRC_FIXEDWING)/stabilization/booz_stabilization_attitude_ref_euler_int.c -# ap.srcs += $(SRC_FIXEDWING)/stabilization/booz_stabilization_attitude_euler_int.c - -# ap.CFLAGS += -DUSE_NAVIGATION -# ap.srcs += $(SRC_FIXEDWING)/guidance/booz2_guidance_h.c -# ap.srcs += $(SRC_FIXEDWING)/guidance/booz2_guidance_v.c - -# ap.srcs += $(SRC_FIXEDWING)/booz2_ins.c -# ap.srcs += math/pprz_geodetic_int.c math/pprz_geodetic_float.c math/pprz_geodetic_double.c # # INS choice @@ -183,12 +126,6 @@ ap.srcs += $(SRC_FIXEDWING)/main_fbw.c # nothing # -# vertical filter float version -# ap.srcs += $(SRC_FIXEDWING)/ins/booz2_vf_float.c -# ap.CFLAGS += -DUSE_VFF -DDT_VFILTER="(1./512.)" - -# ap.srcs += $(SRC_FIXEDWING)/booz2_navigation.c - # # FMS choice diff --git a/conf/autopilot/lisa_l.makefile b/conf/autopilot/lisa_l.makefile new file mode 100644 index 0000000000..70e1b604b6 --- /dev/null +++ b/conf/autopilot/lisa_l.makefile @@ -0,0 +1,13 @@ +# Makefile for the Lisa board + +ap.ARCHDIR = $(ARCHI) +ap.ARCH = arm7tdmi +ap.TARGET = autopilot +ap.TARGETDIR = autopilot + +ARCH=stm32 +ARCHI=stm32 +SRC_ARCH=$(ARCH) +BOARD_CFG=\"boards/lisa_0.99.h\" +FLASH_MODE=JTAG + diff --git a/conf/autopilot/subsystems/fixedwing_actuators_4017.makefile b/conf/autopilot/subsystems/fixedwing_actuators_4017.makefile new file mode 100644 index 0000000000..bef7d2a78e --- /dev/null +++ b/conf/autopilot/subsystems/fixedwing_actuators_4017.makefile @@ -0,0 +1,5 @@ + + +ap.CFLAGS += -DACTUATORS=\"servos_4017_hw.h\" -DSERVOS_4017 +ap.srcs += $(SRC_FIXEDWING_ARCH)/servos_4017_hw.c $(SRC_FIXEDWING)/actuators.c + diff --git a/conf/autopilot/subsystems/fixedwing_gps_ublox.makefile b/conf/autopilot/subsystems/fixedwing_gps_ublox.makefile new file mode 100644 index 0000000000..56588af63d --- /dev/null +++ b/conf/autopilot/subsystems/fixedwing_gps_ublox.makefile @@ -0,0 +1,13 @@ + + + +ifeq ($(GPS_UART), Uart0) +ap.CFLAGS += -DUSE_UART0 -DUART0_BAUD=B$(GPS_BAUD) +else +ap.CFLAGS += -DUSE_UART1 -DUART1_BAUD=B$(GPS_BAUD) +endif + + +ap.CFLAGS += -DGPS -DUBX -DGPS_LINK=$(GPS_UART) +ap.srcs += $(SRC_FIXEDWING)/gps_ubx.c $(SRC_FIXEDWING)/gps.c $(SRC_FIXEDWING)/latlong.c + diff --git a/conf/autopilot/subsystems/fixedwing_telemetry_transparent.makefile b/conf/autopilot/subsystems/fixedwing_telemetry_transparent.makefile new file mode 100644 index 0000000000..0baab3860e --- /dev/null +++ b/conf/autopilot/subsystems/fixedwing_telemetry_transparent.makefile @@ -0,0 +1,15 @@ + + +ifeq ($(MODEM_UART), Uart0) +ap.CFLAGS += -DUSE_UART0 -DUART0_BAUD=B$(MODEM_BAUD) +else +ap.CFLAGS += -DUSE_UART1 -DUART1_BAUD=B$(MODEM_BAUD) +endif + + + +ap.CFLAGS += -DDOWNLINK -DDOWNLINK_FBW_DEVICE=$(MODEM_UART) -DDOWNLINK_AP_DEVICE=$(MODEM_UART) -DPPRZ_UART=$(MODEM_UART) +ap.CFLAGS += -DDOWNLINK_TRANSPORT=PprzTransport -DDATALINK=PPRZ +ap.srcs += $(SRC_FIXEDWING)/downlink.c $(SRC_FIXEDWING)/datalink.c $(SRC_FIXEDWING)/pprz_transport.c + + diff --git a/conf/autopilot/subsystems/fixedwing_telemetry_xbee24.makefile b/conf/autopilot/subsystems/fixedwing_telemetry_xbee24.makefile new file mode 100644 index 0000000000..4d563abb33 --- /dev/null +++ b/conf/autopilot/subsystems/fixedwing_telemetry_xbee24.makefile @@ -0,0 +1,5 @@ + +ap.CFLAGS += -DDOWNLINK -DUSE_UART1 -DDOWNLINK_TRANSPORT=PprzTransport -DDOWNLINK_FBW_DEVICE=Uart1 -DDOWNLINK_AP_DEVICE=Uart1 -DPPRZ_UART=Uart1 -DDATALINK=PPRZ -DUART1_BAUD=B9600 +ap.srcs += $(SRC_FIXEDWING)/downlink.c $(SRC_FIXEDWING)/datalink.c $(SRC_FIXEDWING)/pprz_transport.c + +