<firmware>

This commit is contained in:
Christophe De Wagter
2010-08-19 14:26:20 +00:00
parent 7bb125dc6c
commit cfd4cfd58b
6 changed files with 134 additions and 58 deletions
+33 -19
View File
@@ -160,36 +160,50 @@
<define name="HOME_RADIUS" value="100" unit="m"/>
</section>
<target name="fixedwing" board="tiny_2.11">
<param name="FLASH_MODE" value="IAP"/>
<firmware name="fixedwing">
<!--
<target name="sim" board="pc" />
-->
<target name="ap" board="tiny_2.11">
<param name="FLASH_MODE" value="IAP" />
<define name="AGR_CLIMB" />
<define name="LOITER_TRIM" />
<define name="WIND_INFO" />
</target>
<subsystem name="autopilot"/>
<subsystem name="radio_control" type="ppm"/>
<subsystem name="radio_control" type="ppm"/>
<!-- Communication -->
<subsystem name="telemetry" type="transparent">
<param name="MODEM_BAUD" value="9600"/>
<subsystem name="telemetry" type="transparent">
<param name="MODEM_BAUD" value="9600"/>
</subsystem>
<!-- Actuators -->
<subsystem name="actuators" type="4017"/>
<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>
<subsystem name="testing"/>
</target>
<subsystem name="attitude" type="infrared"/>
<subsystem name="gps" type="ublox_lea4p"/>
<subsystem name="navigation"/>
<modules>
</modules>
</firmware>
<!--
<firmware name="setup">
<target name="tunnel" board="tiny_2.11" />
<target name="setup_actuators" board="tiny_2.11" />
</firmware>
-->
<makefile location="after">
ap.CFLAGS += -DTRAFFIC_INFO -DALT_KALMAN
sim.CFLAGS += -DTRAFFIC_INFO
include $(PAPARAZZI_SRC)/conf/autopilot/sitl.makefile
sim.CFLAGS += -DBOARD_CONFIG=\"tiny.h\"
</makefile>
</airframe>
+8 -4
View File
@@ -1,6 +1,6 @@
<!-- Paparazzi airframe DTD -->
<!ELEMENT airframe (servos|commands|csc_boards|rc_commands|auto_rc_commands|ap_only_commands|command_laws|section|makefile|modules|target)*>
<!ELEMENT airframe (servos|commands|csc_boards|rc_commands|auto_rc_commands|ap_only_commands|command_laws|section|makefile|modules|firmware)*>
<!ELEMENT servos (servo)*>
<!ELEMENT commands (axis)*>
<!ELEMENT csc_boards (board)*>
@@ -23,8 +23,12 @@
<!ELEMENT modules (load)*>
<!ELEMENT load EMPTY>
<!ELEMENT param EMPTY>
<!ELEMENT target (subsystem|param)*>
<!ELEMENT subsystem (define|param)*>
<!ELEMENT firmware (target|subsystem|modules)*>
<!ELEMENT target (param|define)*>
<!ELEMENT subsystem (param)*>
<!ATTLIST firmware
name CDATA #REQUIRED>
<!ATTLIST target
name CDATA #REQUIRED
@@ -86,7 +90,7 @@ value CDATA #REQUIRED>
<!ATTLIST define
name CDATA #REQUIRED
value CDATA #REQUIRED
value CDATA #IMPLIED
unit CDATA #IMPLIED
integer CDATA #IMPLIED>
+7
View File
@@ -14,3 +14,10 @@ SRC_FIXEDWING_TEST=$(SRC_FIXEDWING)/
FIXEDWING_INC = -I$(SRC_FIXEDWING) -I$(SRC_FIXEDWING_ARCH)
# Standard Fixed Wing Code
include $(CFG_FIXEDWING)/autopilot.makefile
include $(PAPARAZZI_SRC)/conf/autopilot/sitl.makefile
+23
View File
@@ -0,0 +1,23 @@
#
# fixed_wings.makefile
#
#
CFG_FIXEDWING=$(PAPARAZZI_SRC)/conf/autopilot/subsystems/fixedwing
SRC_FIXEDWING=.
SRC_FIXEDWING_ARCH=$(SRC_FIXEDWING)/$(ARCH)
SRC_FIXEDWING_TEST=$(SRC_FIXEDWING)/
FIXEDWING_INC = -I$(SRC_FIXEDWING) -I$(SRC_FIXEDWING_ARCH)
# Standard Fixed Wing Code
include $(CFG_FIXEDWING)/autopilot.makefile
include $(PAPARAZZI_SRC)/conf/autopilot/sitl.makefile
+18
View File
@@ -0,0 +1,18 @@
#
# pc.makefile
#
# Linux PC
#
ARCH=sim
ARCHI=sim
BOARD_CFG = \"tiny.h\"
sim.ARCHDIR = $(ARCHI)
sim.ARCH = sitl
sim.TARGET = autopilot
sim.TARGETDIR = autopilot
+45 -35
View File
@@ -150,47 +150,57 @@ let dump_makefile_section = fun xml makefile_ac airframe_infile print_if_loc_aft
end)
(Xml.children xml)
(** Firnware Children **)
let parse_firmware = fun makefile_ac tag firmware ->
match Xml.tag firmware with
"subsystem" ->
begin try
fprintf makefile_ac "# -subsystem: '%s' \n" (Xml.attrib firmware "name");
let has_subtype = ref false in
begin try
has_subtype := not (String.compare (Xml.attrib firmware "type") "" = 0)
with _ -> () end;
let print_if_subsystem_define = (fun d ->
if ExtXml.tag_is d "param" then begin
fprintf makefile_ac "%s = %s\n"
(String.uppercase(Xml.attrib d "name"))
(Xml.attrib d "value");
end) in
List.iter print_if_subsystem_define (Xml.children firmware);
fprintf makefile_ac "include $(CFG_%s)/%s"
(String.uppercase(Xml.attrib tag "name"))
(Xml.attrib firmware "name");
if !has_subtype then
fprintf makefile_ac "_%s"
(Xml.attrib firmware "type");
fprintf makefile_ac ".makefile\n"
with _ -> () end;
| "target" ->
begin try
fprintf makefile_ac "\n###########\n# -target: '%s' \n" (Xml.attrib firmware "name");
let print_if_subsystem = (fun c ->
if ExtXml.tag_is c "param" then begin
fprintf makefile_ac "%s = %s\n"
(String.uppercase(Xml.attrib c "name"))
(Xml.attrib c "value")
end) in
List.iter print_if_subsystem (Xml.children firmware);
fprintf makefile_ac "include $(PAPARAZZI_SRC)/conf/boards/%s.makefile\n" (Xml.attrib firmware "board")
with _ -> () end;
| _ -> ()
(**
Search and dump the target section
Search and dump the firmware section
**)
let dump_target_section = fun xml makefile_ac ->
List.iter (fun tag ->
if ExtXml.tag_is tag "target" then begin
if ExtXml.tag_is tag "firmware" then begin
begin try
fprintf makefile_ac "\n# makefile target '%s' board '%s'\n" (Xml.attrib tag "name") (Xml.attrib tag "board");
let print_if_subsystem = (fun c ->
if ExtXml.tag_is c "param" then begin
fprintf makefile_ac "%s = %s\n"
(String.uppercase(Xml.attrib c "name"))
(Xml.attrib c "value")
end) in
List.iter print_if_subsystem (Xml.children tag);
fprintf makefile_ac "include $(PAPARAZZI_SRC)/conf/boards/%s.makefile\n" (Xml.attrib tag "board");
fprintf makefile_ac "\n######################\n# makefile firmware '%s' \n" (Xml.attrib tag "name");
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
let has_subtype = ref false in
begin try
has_subtype := not (String.compare (Xml.attrib c "type") "" = 0)
with _ -> () end;
let print_if_subsystem_define = (fun d ->
if ExtXml.tag_is d "param" then begin
fprintf makefile_ac "%s = %s\n"
(String.uppercase(Xml.attrib d "name"))
(Xml.attrib d "value");
end) in
List.iter print_if_subsystem_define (Xml.children c);
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"
end) in
List.iter print_if_subsystem (Xml.children tag)
List.iter (parse_firmware makefile_ac tag) (Xml.children tag )
with _ -> () end;
end)
(Xml.children xml)