From ea8105864dae82413cbbb2215bf8fa4fa549322f Mon Sep 17 00:00:00 2001 From: Christophe De Wagter Date: Wed, 18 Aug 2010 12:38:05 +0000 Subject: [PATCH] Both target/subsystem compilers for makefile/airframe.h are ready --- conf/airframes/AirborneCodeReorg/TinyFw.xml | 63 ++++++++----------- conf/airframes/airframe.dtd | 7 ++- conf/airframes/microjet5.xml | 2 +- conf/airframes/microjet_example.xml | 18 +++--- conf/autopilot/fixed_wings.makefile | 5 -- ...ing_common.makefile => fixedwing.makefile} | 10 ++- .../actuators_4015.makefile} | 0 .../actuators_4017.makefile} | 0 .../actuators_ppm.makefile} | 0 .../attitude_infrared.makefile} | 0 .../fixedwing/autopilot.makefile} | 2 +- .../ets_airspeed.makefile} | 0 .../gps_ublox_lea4p.makefile} | 0 .../gps_ublox_lea5h.makefile} | 0 .../gyro.makefile} | 0 .../hum_baro_payload.makefile} | 0 .../joystick.makefile} | 0 .../navigation.makefile} | 6 ++ .../radio_control_ppm.makefile | 0 .../telemetry_transparent.makefile} | 0 .../telemetry_xbee_api.makefile} | 0 .../subsystems/fixedwing/testing.makefile | 58 +++++++++++++++++ .../fixedwing_radio_control_ppm.makefile | 5 -- conf/boards/tiny_2.1.makefile | 4 ++ conf/boards/tiny_2.11.makefile | 39 ++++++++++++ conf/boards/twog_1.makefile | 9 +++ sw/tools/gen_aircraft.ml | 20 ++++-- sw/tools/gen_airframe.ml | 21 +++++++ 28 files changed, 203 insertions(+), 66 deletions(-) delete mode 100644 conf/autopilot/fixed_wings.makefile rename conf/autopilot/{fixedwing_common.makefile => fixedwing.makefile} (62%) rename conf/autopilot/subsystems/{fixedwing_actuators_4015.makefile => fixedwing/actuators_4015.makefile} (100%) rename conf/autopilot/subsystems/{fixedwing_actuators_4017.makefile => fixedwing/actuators_4017.makefile} (100%) rename conf/autopilot/subsystems/{fixedwing_actuators_ppm.makefile => fixedwing/actuators_ppm.makefile} (100%) rename conf/autopilot/subsystems/{fixedwing_attitude_infrared.makefile => fixedwing/attitude_infrared.makefile} (100%) rename conf/autopilot/{fixedwing_autopilot.makefile => subsystems/fixedwing/autopilot.makefile} (99%) rename conf/autopilot/subsystems/{fixedwing_ets_airspeed.makefile => fixedwing/ets_airspeed.makefile} (100%) rename conf/autopilot/subsystems/{fixedwing_gps_ublox_lea4p.makefile => fixedwing/gps_ublox_lea4p.makefile} (100%) rename conf/autopilot/subsystems/{fixedwing_gps_ublox_lea5h.makefile => fixedwing/gps_ublox_lea5h.makefile} (100%) rename conf/autopilot/subsystems/{fixedwing_gyro.makefile => fixedwing/gyro.makefile} (100%) rename conf/autopilot/subsystems/{fixedwing_hum_baro_payload.makefile => fixedwing/hum_baro_payload.makefile} (100%) rename conf/autopilot/subsystems/{fixedwing_joystick.makefile => fixedwing/joystick.makefile} (100%) rename conf/autopilot/subsystems/{fixedwing_navigation.makefile => fixedwing/navigation.makefile} (84%) rename conf/autopilot/subsystems/{fixed_wings => fixedwing}/radio_control_ppm.makefile (100%) rename conf/autopilot/subsystems/{fixedwing_telemetry_transparent.makefile => fixedwing/telemetry_transparent.makefile} (100%) rename conf/autopilot/subsystems/{fixedwing_telemetry_xbee_api.makefile => fixedwing/telemetry_xbee_api.makefile} (100%) create mode 100644 conf/autopilot/subsystems/fixedwing/testing.makefile delete mode 100644 conf/autopilot/subsystems/fixedwing_radio_control_ppm.makefile create mode 100644 conf/boards/twog_1.makefile diff --git a/conf/airframes/AirborneCodeReorg/TinyFw.xml b/conf/airframes/AirborneCodeReorg/TinyFw.xml index d9027fa7b1..e81d415989 100644 --- a/conf/airframes/AirborneCodeReorg/TinyFw.xml +++ b/conf/airframes/AirborneCodeReorg/TinyFw.xml @@ -7,6 +7,7 @@ --> + @@ -158,48 +159,36 @@ - -BOARD_CFG = \"tiny_2_1_1.h\" -FLASH_MODE = IAP + + + + + + + + + + + + + + + + + + + + -# Board Specifics -include $(PAPARAZZI_SRC)/conf/autopilot/tiny.makefile + -# Fixed Wing Specifics -include $(PAPARAZZI_SRC)/conf/autopilot/fixedwing_common.makefile -include $(CFG_FIXEDWING)/fixedwing_autopilot.makefile -include $(CFG_FIXEDWING)/subsystems/fixedwing_navigation.makefile - -# IO Options -include $(CFG_FIXEDWING)/subsystems/fixedwing_radio_control_ppm.makefile -include $(CFG_FIXEDWING)/subsystems/fixedwing_actuators_4017.makefile - -# Sensors -include $(CFG_FIXEDWING)/subsystems/fixedwing_attitude_infrared.makefile -include $(CFG_FIXEDWING)/subsystems/fixedwing_gyro.makefile - -### (UART 0, 38400baud) are the default GPS parameters, change and uncomment if needed -#GPS_UART_NR = 0 -#GPS_BAUD = 38400 -include $(CFG_FIXEDWING)/subsystems/fixedwing_gps_ublox_lea4p.makefile - -### (UART 1, 57600baud) are default modem parameters, change and uncomment if needed -#MODEM_UART_NR = 1 -MODEM_BAUD = 9600 -include $(CFG_FIXEDWING)/subsystems/fixedwing_telemetry_transparent.makefile +ap.CFLAGS += -DTRAFFIC_INFO -DALT_KALMAN +sim.CFLAGS += -DTRAFFIC_INFO -# Special options -ap.CFLAGS += -DAGR_CLIMB -DLOITER_TRIM -DALT_KALMAN -DWIND_INFO - -ap.CFLAGS += -DTRAFFIC_INFO -ap.srcs += traffic_info.c - -###################################### -# Config for SITL simulation include $(PAPARAZZI_SRC)/conf/autopilot/sitl.makefile -sim.CFLAGS += -DBOARD_CONFIG=\"tiny.h\" -DAGR_CLIMB -DLOITER_TRIM -DALT_KALMAN -DWIND_INFO -DTRAFFIC_INFO -sim.srcs += traffic_info.c +sim.CFLAGS += -DBOARD_CONFIG=\"tiny.h\" + diff --git a/conf/airframes/airframe.dtd b/conf/airframes/airframe.dtd index c02b7e9b37..4b290dea7a 100644 --- a/conf/airframes/airframe.dtd +++ b/conf/airframes/airframe.dtd @@ -22,8 +22,9 @@ + - + + + - + diff --git a/conf/airframes/microjet_example.xml b/conf/airframes/microjet_example.xml index b130631385..3842dae88a 100644 --- a/conf/airframes/microjet_example.xml +++ b/conf/airframes/microjet_example.xml @@ -8,7 +8,7 @@ - + @@ -172,26 +172,26 @@ FLASH_MODE=IAP include $(PAPARAZZI_SRC)/conf/autopilot/tiny.makefile # Fixed Wing Specifics -include $(PAPARAZZI_SRC)/conf/autopilot/fixedwing_common.makefile -include $(CFG_FIXEDWING)/fixedwing_autopilot.makefile -include $(CFG_FIXEDWING)/subsystems/fixedwing_navigation.makefile +include $(PAPARAZZI_SRC)/conf/autopilot/fixedwing.makefile +include $(CFG_FIXEDWING)/autopilot.makefile +include $(CFG_FIXEDWING)/navigation.makefile # IO Options -include $(CFG_FIXEDWING)/subsystems/fixedwing_actuators_4015.makefile +include $(CFG_FIXEDWING)/actuators_4015.makefile # Sensors -include $(CFG_FIXEDWING)/subsystems/fixedwing_attitude_infrared.makefile -include $(CFG_FIXEDWING)/subsystems/fixedwing_gyro.makefile +include $(CFG_FIXEDWING)/attitude_infrared.makefile +include $(CFG_FIXEDWING)/gyro.makefile ### (UART 0, 38400baud) are the default GPS parameters, change and uncomment if needed #GPS_UART_NR = 0 #GPS_BAUD = 38400 -include $(CFG_FIXEDWING)/subsystems/fixedwing_gps_ublox_lea5h.makefile +include $(CFG_FIXEDWING)/gps_ublox_lea5h.makefile ### (UART 1, 57600baud) are default modem parameters, change and uncomment if needed #MODEM_UART_NR = 1 #MODEM_BAUD = 57600 -include $(CFG_FIXEDWING)/subsystems/fixedwing_telemetry_xbee_api.makefile +include $(CFG_FIXEDWING)/telemetry_xbee_api.makefile # Special options diff --git a/conf/autopilot/fixed_wings.makefile b/conf/autopilot/fixed_wings.makefile deleted file mode 100644 index 5c801c103b..0000000000 --- a/conf/autopilot/fixed_wings.makefile +++ /dev/null @@ -1,5 +0,0 @@ -# -# fixed_wings.makefile -# -# -CFG_FIXED_WINGS=$(PAPARAZZI_SRC)/conf/autopilot/subsystems/fixed_wings \ No newline at end of file diff --git a/conf/autopilot/fixedwing_common.makefile b/conf/autopilot/fixedwing.makefile similarity index 62% rename from conf/autopilot/fixedwing_common.makefile rename to conf/autopilot/fixedwing.makefile index 5fbf7dafb4..54400a6cc0 100644 --- a/conf/autopilot/fixedwing_common.makefile +++ b/conf/autopilot/fixedwing.makefile @@ -1,10 +1,16 @@ +# +# fixed_wings.makefile +# +# +CFG_FIXEDWING=$(PAPARAZZI_SRC)/conf/autopilot/subsystems/fixedwing + SRC_FIXEDWING=. SRC_FIXEDWING_ARCH=$(SRC_FIXEDWING)/$(ARCH) SRC_FIXEDWING_TEST=$(SRC_FIXEDWING)/ -CFG_FIXEDWING=$(PAPARAZZI_SRC)/conf/autopilot - FIXEDWING_INC = -I$(SRC_FIXEDWING) -I$(SRC_FIXEDWING_ARCH) + + diff --git a/conf/autopilot/subsystems/fixedwing_actuators_4015.makefile b/conf/autopilot/subsystems/fixedwing/actuators_4015.makefile similarity index 100% rename from conf/autopilot/subsystems/fixedwing_actuators_4015.makefile rename to conf/autopilot/subsystems/fixedwing/actuators_4015.makefile diff --git a/conf/autopilot/subsystems/fixedwing_actuators_4017.makefile b/conf/autopilot/subsystems/fixedwing/actuators_4017.makefile similarity index 100% rename from conf/autopilot/subsystems/fixedwing_actuators_4017.makefile rename to conf/autopilot/subsystems/fixedwing/actuators_4017.makefile diff --git a/conf/autopilot/subsystems/fixedwing_actuators_ppm.makefile b/conf/autopilot/subsystems/fixedwing/actuators_ppm.makefile similarity index 100% rename from conf/autopilot/subsystems/fixedwing_actuators_ppm.makefile rename to conf/autopilot/subsystems/fixedwing/actuators_ppm.makefile diff --git a/conf/autopilot/subsystems/fixedwing_attitude_infrared.makefile b/conf/autopilot/subsystems/fixedwing/attitude_infrared.makefile similarity index 100% rename from conf/autopilot/subsystems/fixedwing_attitude_infrared.makefile rename to conf/autopilot/subsystems/fixedwing/attitude_infrared.makefile diff --git a/conf/autopilot/fixedwing_autopilot.makefile b/conf/autopilot/subsystems/fixedwing/autopilot.makefile similarity index 99% rename from conf/autopilot/fixedwing_autopilot.makefile rename to conf/autopilot/subsystems/fixedwing/autopilot.makefile index a08136c6a5..6e00798c9e 100644 --- a/conf/autopilot/fixedwing_autopilot.makefile +++ b/conf/autopilot/subsystems/fixedwing/autopilot.makefile @@ -4,7 +4,7 @@ # Copyright (C) 2008 Antoine Drouin # # This file is part of paparazzi. -# +#tin # paparazzi is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) diff --git a/conf/autopilot/subsystems/fixedwing_ets_airspeed.makefile b/conf/autopilot/subsystems/fixedwing/ets_airspeed.makefile similarity index 100% rename from conf/autopilot/subsystems/fixedwing_ets_airspeed.makefile rename to conf/autopilot/subsystems/fixedwing/ets_airspeed.makefile diff --git a/conf/autopilot/subsystems/fixedwing_gps_ublox_lea4p.makefile b/conf/autopilot/subsystems/fixedwing/gps_ublox_lea4p.makefile similarity index 100% rename from conf/autopilot/subsystems/fixedwing_gps_ublox_lea4p.makefile rename to conf/autopilot/subsystems/fixedwing/gps_ublox_lea4p.makefile diff --git a/conf/autopilot/subsystems/fixedwing_gps_ublox_lea5h.makefile b/conf/autopilot/subsystems/fixedwing/gps_ublox_lea5h.makefile similarity index 100% rename from conf/autopilot/subsystems/fixedwing_gps_ublox_lea5h.makefile rename to conf/autopilot/subsystems/fixedwing/gps_ublox_lea5h.makefile diff --git a/conf/autopilot/subsystems/fixedwing_gyro.makefile b/conf/autopilot/subsystems/fixedwing/gyro.makefile similarity index 100% rename from conf/autopilot/subsystems/fixedwing_gyro.makefile rename to conf/autopilot/subsystems/fixedwing/gyro.makefile diff --git a/conf/autopilot/subsystems/fixedwing_hum_baro_payload.makefile b/conf/autopilot/subsystems/fixedwing/hum_baro_payload.makefile similarity index 100% rename from conf/autopilot/subsystems/fixedwing_hum_baro_payload.makefile rename to conf/autopilot/subsystems/fixedwing/hum_baro_payload.makefile diff --git a/conf/autopilot/subsystems/fixedwing_joystick.makefile b/conf/autopilot/subsystems/fixedwing/joystick.makefile similarity index 100% rename from conf/autopilot/subsystems/fixedwing_joystick.makefile rename to conf/autopilot/subsystems/fixedwing/joystick.makefile diff --git a/conf/autopilot/subsystems/fixedwing_navigation.makefile b/conf/autopilot/subsystems/fixedwing/navigation.makefile similarity index 84% rename from conf/autopilot/subsystems/fixedwing_navigation.makefile rename to conf/autopilot/subsystems/fixedwing/navigation.makefile index 5cb3ed3f10..a67bc06609 100644 --- a/conf/autopilot/subsystems/fixedwing_navigation.makefile +++ b/conf/autopilot/subsystems/fixedwing/navigation.makefile @@ -3,5 +3,11 @@ ap.CFLAGS += -DNAV ap.srcs += $(SRC_FIXEDWING)/nav.c $(SRC_FIXEDWING)/fw_h_ctl.c $(SRC_FIXEDWING)/fw_v_ctl.c ap.srcs += $(SRC_FIXEDWING)/nav_survey_rectangle.c $(SRC_FIXEDWING)/nav_line.c +ap.srcs += traffic_info.c + + sim.srcs += $(SRC_FIXEDWING)/nav_survey_rectangle.c $(SRC_FIXEDWING)/nav_line.c +sim.srcs += traffic_info.c + + diff --git a/conf/autopilot/subsystems/fixed_wings/radio_control_ppm.makefile b/conf/autopilot/subsystems/fixedwing/radio_control_ppm.makefile similarity index 100% rename from conf/autopilot/subsystems/fixed_wings/radio_control_ppm.makefile rename to conf/autopilot/subsystems/fixedwing/radio_control_ppm.makefile diff --git a/conf/autopilot/subsystems/fixedwing_telemetry_transparent.makefile b/conf/autopilot/subsystems/fixedwing/telemetry_transparent.makefile similarity index 100% rename from conf/autopilot/subsystems/fixedwing_telemetry_transparent.makefile rename to conf/autopilot/subsystems/fixedwing/telemetry_transparent.makefile diff --git a/conf/autopilot/subsystems/fixedwing_telemetry_xbee_api.makefile b/conf/autopilot/subsystems/fixedwing/telemetry_xbee_api.makefile similarity index 100% rename from conf/autopilot/subsystems/fixedwing_telemetry_xbee_api.makefile rename to conf/autopilot/subsystems/fixedwing/telemetry_xbee_api.makefile diff --git a/conf/autopilot/subsystems/fixedwing/testing.makefile b/conf/autopilot/subsystems/fixedwing/testing.makefile new file mode 100644 index 0000000000..a0ae3479f6 --- /dev/null +++ b/conf/autopilot/subsystems/fixedwing/testing.makefile @@ -0,0 +1,58 @@ +## TODO This file probably needs to move to the board specific folder + +# a test program to setup actuators +setup_actuators.ARCHDIR = $(ARCHI) +setup_actuators.ARCH = arm7tdmi +setup_actuators.TARGET = setup_actuators +setup_actuators.TARGETDIR = setup_actuators + +setup_actuators.CFLAGS += -DFBW -DBOARD_CONFIG=\"tiny.h\" -DLED -DTIME_LED=1 -DACTUATORS=\"servos_4015_hw.h\" -DSERVOS_4015 -DUSE_UART0 -DUART0_BAUD=B9600 -DDATALINK=PPRZ -DPPRZ_UART=Uart0 +setup_actuators.srcs += sys_time.c $(SRC_ARCH)/sys_time_hw.c $(SRC_ARCH)/armVIC.c pprz_transport.c setup_actuators.c $(SRC_ARCH)/uart_hw.c $(SRC_ARCH)/servos_4015_hw.c main.c + + +# a test program to tunnel between both uart +tunnel.ARCHDIR = $(ARCHI) +tunnel.ARCH = arm7tdmi +tunnel.TARGET = tunnel +tunnel.TARGETDIR = tunnel + +tunnel.CFLAGS += -DFBW -DBOARD_CONFIG=\"tiny_2_1_1_usb.h\" -DLED +tunnel.srcs += $(SRC_ARCH)/uart_tunnel.c + + +# A test program to monitor the ADC values +test_adcs.ARCHDIR = $(ARCHI) +test_adcs.ARCH = arm7tdmi +test_adcs.TARGET = test_adcs +test_adcs.TARGETDIR = test_adcs + +test_adcs.CFLAGS += -DBOARD_CONFIG=$(CONFIG) -DLED -DTIME_LED=1 -DADC -DUSE_ADC_0 -DUSE_ADC_1 -DUSE_ADC_2 -DUSE_ADC_3 -DUSE_ADC_4 -DUSE_ADC_5 -DUSE_ADC_6 -DUSE_ADC_7 +test_adcs.CFLAGS += -DDOWNLINK -DUSE_UART0 -DDOWNLINK_TRANSPORT=XBeeTransport -DDOWNLINK_FBW_DEVICE=Uart0 -DDOWNLINK_AP_DEVICE=Uart0 -DXBEE_UART=Uart0 -DDATALINK=XBEE -DUART0_BAUD=B9600 +test_adcs.srcs += downlink.c $(SRC_ARCH)/uart_hw.c xbee.c + +test_adcs.srcs += sys_time.c $(SRC_ARCH)/adc_hw.c $(SRC_ARCH)/sys_time_hw.c $(SRC_ARCH)/armVIC.c test_adcs.c +# pprz_transport.c + + +# a configuration program to access both uart through usb +usb_tunnel_0.ARCHDIR = $(ARCHI) +usb_tunnel_0.ARCH = arm7tdmi +usb_tunnel_0.TARGET = usb_tunnel_0 +usb_tunnel_0.TARGETDIR = usb_tunnel_0 +usb_tunnel_0.CFLAGS += -DFBW -DBOARD_CONFIG=\"tiny_2_1_1_usb.h\" -DUSE_UART0 -DUART0_BAUD=B115200 +usb_tunnel_0.CFLAGS += -DUSE_USB_LINE_CODING -DUSE_USB_SERIAL -DLED +usb_tunnel_0.srcs += $(SRC_ARCH)/usb_tunnel.c $(SRC_ARCH)/usb_ser_hw.c $(SRC_ARCH)/uart_hw.c +usb_tunnel_0.srcs += $(SRC_ARCH)/lpcusb/usbhw_lpc.c $(SRC_ARCH)/lpcusb/usbinit.c +usb_tunnel_0.srcs += $(SRC_ARCH)/lpcusb/usbcontrol.c $(SRC_ARCH)/lpcusb/usbstdreq.c +usb_tunnel_0.srcs += sys_time.c $(SRC_ARCH)/sys_time_hw.c $(SRC_ARCH)/armVIC.c + +usb_tunnel_1.ARCHDIR = $(ARCHI) +usb_tunnel_1.ARCH = arm7tdmi +usb_tunnel_1.TARGET = usb_tunnel_1 +usb_tunnel_1.TARGETDIR = usb_tunnel_1 +usb_tunnel_1.CFLAGS += -DFBW -DBOARD_CONFIG=\"tiny_2_1_1_usb.h\" -DUSE_UART1 -DUART1_BAUD=B115200 +usb_tunnel_1.CFLAGS += -DUSE_USB_LINE_CODING -DUSE_USB_SERIAL -DLED +usb_tunnel_1.srcs += $(SRC_ARCH)/usb_tunnel.c $(SRC_ARCH)/usb_ser_hw.c $(SRC_ARCH)/uart_hw.c +usb_tunnel_1.srcs += $(SRC_ARCH)/lpcusb/usbhw_lpc.c $(SRC_ARCH)/lpcusb/usbinit.c +usb_tunnel_1.srcs += $(SRC_ARCH)/lpcusb/usbcontrol.c $(SRC_ARCH)/lpcusb/usbstdreq.c +usb_tunnel_1.srcs += sys_time.c $(SRC_ARCH)/sys_time_hw.c $(SRC_ARCH)/armVIC.c diff --git a/conf/autopilot/subsystems/fixedwing_radio_control_ppm.makefile b/conf/autopilot/subsystems/fixedwing_radio_control_ppm.makefile deleted file mode 100644 index 04f52ece8b..0000000000 --- a/conf/autopilot/subsystems/fixedwing_radio_control_ppm.makefile +++ /dev/null @@ -1,5 +0,0 @@ - -ap.CFLAGS += -DRADIO_CONTROL -ap.srcs += $(SRC_FIXEDWING)/radio_control.c $(SRC_ARCH)/ppm_hw.c - - diff --git a/conf/boards/tiny_2.1.makefile b/conf/boards/tiny_2.1.makefile index 6f88e3ef60..8c22e8e496 100644 --- a/conf/boards/tiny_2.1.makefile +++ b/conf/boards/tiny_2.1.makefile @@ -3,3 +3,7 @@ # # http://paparazzi.enac.fr/wiki/Tiny_v2 # + +include tiny_2.11.makefile + + diff --git a/conf/boards/tiny_2.11.makefile b/conf/boards/tiny_2.11.makefile index 53bc0757f8..7c4f36a134 100644 --- a/conf/boards/tiny_2.11.makefile +++ b/conf/boards/tiny_2.11.makefile @@ -3,3 +3,42 @@ # # http://paparazzi.enac.fr/wiki/Tiny_v2 # +# TODO: move all to new directories +# ARCH=lpc21 +ARCH=arm7 +ARCHI=arm7 +BOARD_CFG = \"tiny_2_1_1.h\" + +ifndef FLASH_MODE +FLASH_MODE = IAP +endif + + +ap.ARCHDIR = $(ARCHI) +ap.ARCH = arm7tdmi +ap.TARGET = autopilot +ap.TARGETDIR = autopilot + +fbw.ARCHDIR = $(ARCHI) +fbw.ARCH = arm7tdmi +fbw.TARGET = autopilot +fbw.TARGETDIR = autopilot + +LPC21ISP_BAUD = 38400 +LPC21ISP_XTAL = 12000 + + +### default settings for tiny and twog +GPS_UART_NR = 0 +GPS_BAUD = 38400 +MODEM_UART_NR = 1 +MODEM_BAUD = 57600 + +ADC_IR1 = ADC_1 +ADC_IR2 = ADC_2 +ADC_IR_TOP = ADC_0 +ADC_IR_NB_SAMPLES = 16 +ADC_GYRO_ROLL = ADC_3 +ADC_GYRO_NB_SAMPLES = 16 + + diff --git a/conf/boards/twog_1.makefile b/conf/boards/twog_1.makefile new file mode 100644 index 0000000000..8c22e8e496 --- /dev/null +++ b/conf/boards/twog_1.makefile @@ -0,0 +1,9 @@ +# +# tiny_2.1.makefile +# +# http://paparazzi.enac.fr/wiki/Tiny_v2 +# + +include tiny_2.11.makefile + + diff --git a/sw/tools/gen_aircraft.ml b/sw/tools/gen_aircraft.ml index f24e032956..2093fe468a 100644 --- a/sw/tools/gen_aircraft.ml +++ b/sw/tools/gen_aircraft.ml @@ -157,16 +157,26 @@ let dump_target_section = fun xml makefile_ac -> List.iter (fun tag -> if ExtXml.tag_is tag "target" then begin begin try - fprintf makefile_ac "\n# makefile target '%s' board '%s'\n\n" (Xml.attrib tag "name") (Xml.attrib tag "board"); + fprintf makefile_ac "\n# makefile target '%s' board '%s'\n" (Xml.attrib tag "name") (Xml.attrib tag "board"); fprintf makefile_ac "include $(PAPARAZZI_SRC)/conf/boards/%s.makefile\n" (Xml.attrib tag "board"); fprintf makefile_ac "include $(PAPARAZZI_SRC)/conf/autopilot/%s.makefile\n" (Xml.attrib tag "name"); + fprintf makefile_ac "\n# Subsystems:'\n"; let print_if_subsystem = (fun c -> if ExtXml.tag_is c "subsystem" then begin - fprintf makefile_ac "include $(CFG_%s)/%s_%s.makefile\n" - (String.uppercase(Xml.attrib tag "name")) - (Xml.attrib c "name") (Xml.attrib c "type"); + let has_subtype = ref false in + begin try + has_subtype := not (String.compare (Xml.attrib c "type") "" = 0) + with _ -> () end; + fprintf makefile_ac "include $(CFG_%s)/%s" + (String.uppercase(Xml.attrib tag "name")) + (Xml.attrib c "name"); + if !has_subtype then + fprintf makefile_ac "_%s" + (Xml.attrib c "type"); + + fprintf makefile_ac ".makefile\n"; let print_if_subsystem_define = (fun d -> - if ExtXml.tag_is d "define" then begin + if ExtXml.tag_is d "param" then begin fprintf makefile_ac "%s = %s\n" (String.uppercase(Xml.attrib d "name")) (Xml.attrib d "value"); diff --git a/sw/tools/gen_airframe.ml b/sw/tools/gen_airframe.ml index 5e6b0af034..8f4bb6be0c 100644 --- a/sw/tools/gen_airframe.ml +++ b/sw/tools/gen_airframe.ml @@ -218,6 +218,23 @@ let parse_ap_only_commands = fun ap_only -> | _ -> xml_error "copy" +let parse_subsystem_defines = fun options -> + match Xml.tag options with + "param" -> + printf "// -param: %s\n" (ExtXml.attrib options "name") + | "define" -> + printf "#define %s %s\n" (ExtXml.attrib options "name") (ExtXml.attrib options "value") + | _ -> xml_error "define|param" + + +let parse_subsystems = fun subsystem -> + match Xml.tag subsystem with + "subsystem" -> + printf "// -%s:\n" (ExtXml.attrib subsystem "name"); + List.iter parse_subsystem_defines (Xml.children subsystem) + | _ -> xml_error "subsystem" + + let parse_command = fun command no -> let command_name = "COMMAND_"^ExtXml.attrib command "name" in define command_name (string_of_int no); @@ -281,6 +298,10 @@ let parse_section = fun s -> | "makefile" -> () (** Ignoring this section *) + | "target" -> + printf "// Subsystems \n"; + List.iter parse_subsystems (Xml.children s); + printf "// End Subsystems\n\n" | _ -> ()