mirror of
https://github.com/paparazzi/paparazzi.git
synced 2026-05-31 12:23:23 +08:00
new makefile section in airframe.xml
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
open Printf
|
||||
|
||||
let _ =
|
||||
let f = Sys.argv.(1) in
|
||||
let xml = Xml.parse_file f in
|
||||
printf "# This file has been generated from %s\n" f;
|
||||
printf "# Please DO NOT EDIT\n";
|
||||
try
|
||||
match Xml.children (ExtXml.child xml "makefile") with
|
||||
[Xml.PCData s] ->
|
||||
printf "%s\n" s
|
||||
| _ -> ()
|
||||
with
|
||||
_ -> ()
|
||||
@@ -102,6 +102,7 @@ let parse_command = fun command ->
|
||||
printf " int16_t _var_%s = %s;\\\n" var v
|
||||
| _ -> xml_error "set|let"
|
||||
|
||||
|
||||
let parse_section = fun s ->
|
||||
match Xml.tag s with
|
||||
"section" ->
|
||||
@@ -140,6 +141,9 @@ let parse_section = fun s ->
|
||||
printf " uint16_t servo_value;\\\n";
|
||||
List.iter parse_command (Xml.children s);
|
||||
printf "}\n"
|
||||
| "makefile" ->
|
||||
()
|
||||
(** Ignoring this section *)
|
||||
| _ -> xml_error "param|servos|command"
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user