mirror of
https://github.com/paparazzi/paparazzi.git
synced 2026-06-01 21:07:40 +08:00
<firmware>
This commit is contained in:
@@ -160,36 +160,50 @@
|
|||||||
<define name="HOME_RADIUS" value="100" unit="m"/>
|
<define name="HOME_RADIUS" value="100" unit="m"/>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
<target name="fixedwing" board="tiny_2.11">
|
<firmware name="fixedwing">
|
||||||
|
<!--
|
||||||
|
<target name="sim" board="pc" />
|
||||||
|
-->
|
||||||
|
<target name="ap" board="tiny_2.11">
|
||||||
<param name="FLASH_MODE" value="IAP" />
|
<param name="FLASH_MODE" value="IAP" />
|
||||||
|
<define name="AGR_CLIMB" />
|
||||||
|
<define name="LOITER_TRIM" />
|
||||||
|
<define name="WIND_INFO" />
|
||||||
|
</target>
|
||||||
|
|
||||||
<subsystem name="autopilot"/>
|
<subsystem name="autopilot"/>
|
||||||
<subsystem name="radio_control" type="ppm"/>
|
<subsystem name="radio_control" type="ppm"/>
|
||||||
|
|
||||||
<!-- Communication -->
|
<!-- Communication -->
|
||||||
<subsystem name="telemetry" type="transparent">
|
<subsystem name="telemetry" type="transparent">
|
||||||
<param name="MODEM_BAUD" value="9600"/>
|
<param name="MODEM_BAUD" value="9600"/>
|
||||||
</subsystem>
|
</subsystem>
|
||||||
|
|
||||||
<!-- Actuators -->
|
<!-- Actuators -->
|
||||||
<subsystem name="actuators" type="4017"/>
|
<subsystem name="actuators" type="4017"/>
|
||||||
|
|
||||||
<!-- Sensors -->
|
<!-- Sensors -->
|
||||||
<subsystem name="gyro"/>
|
<subsystem name="gyro"/>
|
||||||
<subsystem name="attitude" type="infrared"/>
|
<subsystem name="attitude" type="infrared"/>
|
||||||
<subsystem name="gps" type="ublox_lea4p"/>
|
<subsystem name="gps" type="ublox_lea4p"/>
|
||||||
<subsystem name="navigation">
|
<subsystem name="navigation"/>
|
||||||
<define name="AGR_CLIMB" value="1" />
|
|
||||||
<define name="LOITER_TRIM" value="1" />
|
<modules>
|
||||||
<define name="WIND_INFO" value="1" />
|
</modules>
|
||||||
</subsystem>
|
|
||||||
<subsystem name="testing"/>
|
</firmware>
|
||||||
</target>
|
<!--
|
||||||
|
<firmware name="setup">
|
||||||
|
<target name="tunnel" board="tiny_2.11" />
|
||||||
|
<target name="setup_actuators" board="tiny_2.11" />
|
||||||
|
</firmware>
|
||||||
|
-->
|
||||||
|
|
||||||
|
|
||||||
<makefile location="after">
|
<makefile location="after">
|
||||||
|
|
||||||
ap.CFLAGS += -DTRAFFIC_INFO -DALT_KALMAN
|
ap.CFLAGS += -DTRAFFIC_INFO -DALT_KALMAN
|
||||||
sim.CFLAGS += -DTRAFFIC_INFO
|
sim.CFLAGS += -DTRAFFIC_INFO
|
||||||
|
|
||||||
|
|
||||||
include $(PAPARAZZI_SRC)/conf/autopilot/sitl.makefile
|
|
||||||
sim.CFLAGS += -DBOARD_CONFIG=\"tiny.h\"
|
|
||||||
|
|
||||||
</makefile>
|
</makefile>
|
||||||
</airframe>
|
</airframe>
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<!-- Paparazzi airframe DTD -->
|
<!-- 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 servos (servo)*>
|
||||||
<!ELEMENT commands (axis)*>
|
<!ELEMENT commands (axis)*>
|
||||||
<!ELEMENT csc_boards (board)*>
|
<!ELEMENT csc_boards (board)*>
|
||||||
@@ -23,8 +23,12 @@
|
|||||||
<!ELEMENT modules (load)*>
|
<!ELEMENT modules (load)*>
|
||||||
<!ELEMENT load EMPTY>
|
<!ELEMENT load EMPTY>
|
||||||
<!ELEMENT param EMPTY>
|
<!ELEMENT param EMPTY>
|
||||||
<!ELEMENT target (subsystem|param)*>
|
<!ELEMENT firmware (target|subsystem|modules)*>
|
||||||
<!ELEMENT subsystem (define|param)*>
|
<!ELEMENT target (param|define)*>
|
||||||
|
<!ELEMENT subsystem (param)*>
|
||||||
|
|
||||||
|
<!ATTLIST firmware
|
||||||
|
name CDATA #REQUIRED>
|
||||||
|
|
||||||
<!ATTLIST target
|
<!ATTLIST target
|
||||||
name CDATA #REQUIRED
|
name CDATA #REQUIRED
|
||||||
@@ -86,7 +90,7 @@ value CDATA #REQUIRED>
|
|||||||
|
|
||||||
<!ATTLIST define
|
<!ATTLIST define
|
||||||
name CDATA #REQUIRED
|
name CDATA #REQUIRED
|
||||||
value CDATA #REQUIRED
|
value CDATA #IMPLIED
|
||||||
unit CDATA #IMPLIED
|
unit CDATA #IMPLIED
|
||||||
integer CDATA #IMPLIED>
|
integer CDATA #IMPLIED>
|
||||||
|
|
||||||
|
|||||||
@@ -14,3 +14,10 @@ SRC_FIXEDWING_TEST=$(SRC_FIXEDWING)/
|
|||||||
FIXEDWING_INC = -I$(SRC_FIXEDWING) -I$(SRC_FIXEDWING_ARCH)
|
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
|
||||||
|
|
||||||
|
|||||||
@@ -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
|
||||||
|
|
||||||
@@ -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
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
+35
-25
@@ -150,29 +150,16 @@ let dump_makefile_section = fun xml makefile_ac airframe_infile print_if_loc_aft
|
|||||||
end)
|
end)
|
||||||
(Xml.children xml)
|
(Xml.children xml)
|
||||||
|
|
||||||
(**
|
(** Firnware Children **)
|
||||||
Search and dump the target section
|
|
||||||
**)
|
let parse_firmware = fun makefile_ac tag firmware ->
|
||||||
let dump_target_section = fun xml makefile_ac ->
|
match Xml.tag firmware with
|
||||||
List.iter (fun tag ->
|
"subsystem" ->
|
||||||
if ExtXml.tag_is tag "target" then begin
|
|
||||||
begin try
|
begin try
|
||||||
fprintf makefile_ac "\n# makefile target '%s' board '%s'\n" (Xml.attrib tag "name") (Xml.attrib tag "board");
|
fprintf makefile_ac "# -subsystem: '%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 tag);
|
|
||||||
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
|
|
||||||
let has_subtype = ref false in
|
let has_subtype = ref false in
|
||||||
begin try
|
begin try
|
||||||
has_subtype := not (String.compare (Xml.attrib c "type") "" = 0)
|
has_subtype := not (String.compare (Xml.attrib firmware "type") "" = 0)
|
||||||
with _ -> () end;
|
with _ -> () end;
|
||||||
let print_if_subsystem_define = (fun d ->
|
let print_if_subsystem_define = (fun d ->
|
||||||
if ExtXml.tag_is d "param" then begin
|
if ExtXml.tag_is d "param" then begin
|
||||||
@@ -180,17 +167,40 @@ let dump_target_section = fun xml makefile_ac ->
|
|||||||
(String.uppercase(Xml.attrib d "name"))
|
(String.uppercase(Xml.attrib d "name"))
|
||||||
(Xml.attrib d "value");
|
(Xml.attrib d "value");
|
||||||
end) in
|
end) in
|
||||||
List.iter print_if_subsystem_define (Xml.children c);
|
List.iter print_if_subsystem_define (Xml.children firmware);
|
||||||
fprintf makefile_ac "include $(CFG_%s)/%s"
|
fprintf makefile_ac "include $(CFG_%s)/%s"
|
||||||
(String.uppercase(Xml.attrib tag "name"))
|
(String.uppercase(Xml.attrib tag "name"))
|
||||||
(Xml.attrib c "name");
|
(Xml.attrib firmware "name");
|
||||||
if !has_subtype then
|
if !has_subtype then
|
||||||
fprintf makefile_ac "_%s"
|
fprintf makefile_ac "_%s"
|
||||||
(Xml.attrib c "type");
|
(Xml.attrib firmware "type");
|
||||||
|
|
||||||
fprintf makefile_ac ".makefile\n"
|
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
|
end) in
|
||||||
List.iter print_if_subsystem (Xml.children tag)
|
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 firmware section
|
||||||
|
**)
|
||||||
|
let dump_target_section = fun xml makefile_ac ->
|
||||||
|
List.iter (fun tag ->
|
||||||
|
if ExtXml.tag_is tag "firmware" then begin
|
||||||
|
begin try
|
||||||
|
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");
|
||||||
|
List.iter (parse_firmware makefile_ac tag) (Xml.children tag )
|
||||||
with _ -> () end;
|
with _ -> () end;
|
||||||
end)
|
end)
|
||||||
(Xml.children xml)
|
(Xml.children xml)
|
||||||
|
|||||||
Reference in New Issue
Block a user