Both target/subsystem compilers for makefile/airframe.h are ready

This commit is contained in:
Christophe De Wagter
2010-08-18 12:38:05 +00:00
parent b16d43b589
commit ea8105864d
28 changed files with 203 additions and 66 deletions
+26 -37
View File
@@ -7,6 +7,7 @@
-->
<airframe name="Fixed Wing Lisa">
<servos>
<servo name="MOTOR" no="0" min="1000" neutral="1000" max="2000"/>
<servo name="AILEVON_LEFT" no="2" min="1130" neutral="1575" max="1880"/>
@@ -158,48 +159,36 @@
<define name="DEFAULT_PITCH" value="0.5" unit="rad"/>
<define name="HOME_RADIUS" value="100" unit="m"/>
</section>
<makefile>
BOARD_CFG = \"tiny_2_1_1.h\"
FLASH_MODE = IAP
<target name="fixedwing" board="tiny_2.11">
<subsystem name="autopilot"/>
<subsystem name="testing"/>
<subsystem name="radio_control" type="ppm"/>
<!-- Communication -->
<subsystem name="telemetry" type="transparent">
<param name="MODEM_BAUD" value="9600"/>
</subsystem>
<!-- Actuators -->
<subsystem name="actuators" type="4017"/>
<!-- Sensors -->
<subsystem name="gyro"/>
<subsystem name="attitude" type="infrared"/>
<subsystem name="gps" type="ublox_lea4p"/>
<subsystem name="navigation">
<define name="AGR_CLIMB" value="1" />
<define name="LOITER_TRIM" value="1" />
<define name="WIND_INFO" value="1" />
</subsystem>
</target>
# Board Specifics
include $(PAPARAZZI_SRC)/conf/autopilot/tiny.makefile
<makefile location="after">
# 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\"
</makefile>
</airframe>
+6 -1
View File
@@ -22,8 +22,9 @@
<!ELEMENT makefile (#PCDATA)>
<!ELEMENT modules (load)*>
<!ELEMENT load EMPTY>
<!ELEMENT param EMPTY>
<!ELEMENT target (subsystem)*>
<!ELEMENT subsystem (define)*>
<!ELEMENT subsystem (define|param)*>
<!ATTLIST target
name CDATA #REQUIRED
@@ -89,6 +90,10 @@ value CDATA #REQUIRED
unit CDATA #IMPLIED
integer CDATA #IMPLIED>
<!ATTLIST param
name CDATA #REQUIRED
value CDATA #REQUIRED>
<!ATTLIST linear
name CDATA #REQUIRED
arity CDATA #REQUIRED
+1 -1
View File
@@ -8,7 +8,7 @@
<airframe name="Microjet 5 Tiny 2.11">
<target name="fixed_wings" board="tiny_2.11">
<target name="fixedwing" board="tiny_2.11">
<subsystem name="radio_control" type="ppm"/>
</target>
+9 -9
View File
@@ -8,7 +8,7 @@
<airframe name="Microjet Tiny 1.1">
<target name="fixed_wings" board="tiny_2.11">
<target name="fixedwing" board="tiny_1.1">
<subsystem name="radio_control" type="ppm"/>
</target>
@@ -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
-5
View File
@@ -1,5 +0,0 @@
#
# fixed_wings.makefile
#
#
CFG_FIXED_WINGS=$(PAPARAZZI_SRC)/conf/autopilot/subsystems/fixed_wings
@@ -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)
@@ -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)
@@ -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
@@ -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
@@ -1,5 +0,0 @@
ap.CFLAGS += -DRADIO_CONTROL
ap.srcs += $(SRC_FIXEDWING)/radio_control.c $(SRC_ARCH)/ppm_hw.c
+4
View File
@@ -3,3 +3,7 @@
#
# http://paparazzi.enac.fr/wiki/Tiny_v2
#
include tiny_2.11.makefile
+39
View File
@@ -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
+9
View File
@@ -0,0 +1,9 @@
#
# tiny_2.1.makefile
#
# http://paparazzi.enac.fr/wiki/Tiny_v2
#
include tiny_2.11.makefile
+15 -5
View File
@@ -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");
+21
View File
@@ -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"
| _ -> ()