mirror of
https://github.com/paparazzi/paparazzi.git
synced 2026-05-30 19:47:50 +08:00
new makefile section in airframe.xml
This commit is contained in:
@@ -83,4 +83,8 @@
|
||||
<define name="THETA0" value="45" unit="deg"/>
|
||||
<define name="PHI0" value="-45" unit="deg"/>
|
||||
</section>
|
||||
<makefile>
|
||||
LOCAL_CFLAGS += -DWAVECARD_ON_UART0
|
||||
$(TARGET).srcs += wavecard.c
|
||||
</makefile>
|
||||
</airframe>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#
|
||||
# $Id$
|
||||
# Copyright (C) 2003 Pascal Brisset, Antoine Drouin
|
||||
# Copyright (C) 2003-2005 Pascal Brisset, Antoine Drouin
|
||||
#
|
||||
# This file is part of paparazzi.
|
||||
#
|
||||
@@ -24,7 +24,7 @@
|
||||
FBW=../fly_by_wire
|
||||
|
||||
|
||||
LOCAL_CFLAGS= $(CTL_BRD_FLAGS) $(GPS_FLAGS) $(SIMUL_FLAGS) -DWAVECARD_ON_UART0
|
||||
LOCAL_CFLAGS= $(CTL_BRD_FLAGS) $(GPS_FLAGS) $(SIMUL_FLAGS)
|
||||
|
||||
VARINCLUDE=$(PAPARAZZI_HOME)/var/include
|
||||
ACINCLUDE = $(PAPARAZZI_HOME)/var/$(AIRCRAFT)
|
||||
@@ -63,8 +63,7 @@ $(TARGET).srcs = \
|
||||
mainloop.c \
|
||||
cam.c \
|
||||
traffic_info.c \
|
||||
datalink.c \
|
||||
wavecard.c
|
||||
datalink.c
|
||||
|
||||
ifeq ($(AIRCRAFT), Gorazoptere_brushless_ANALOG)
|
||||
$(TARGET).srcs += ahrs.S
|
||||
@@ -77,6 +76,7 @@ ifeq ($(AIRCRAFT), quadRotorJP)
|
||||
endif
|
||||
|
||||
|
||||
include $(PAPARAZZI_HOME)/var/$(AIRCRAFT)/Makefile.ac
|
||||
include ../../../conf/Makefile.local
|
||||
include ../../../conf/Makefile.avr
|
||||
|
||||
|
||||
@@ -72,7 +72,7 @@ int main( void ) {
|
||||
nav_init();
|
||||
ir_init();
|
||||
estimator_init();
|
||||
#if defined SECTION_IMU_3DMG || defined SECTION_IMU_ANALOG || WAVECARD_ON_UART0
|
||||
#if defined SECTION_IMU_3DMG || defined SECTION_IMU_ANALOG || WAVECARD
|
||||
uart0_init();
|
||||
#endif //SECTION_IMU
|
||||
/** - start interrupt task */
|
||||
@@ -114,10 +114,12 @@ int main( void ) {
|
||||
gps_pos_available = FALSE;
|
||||
}
|
||||
}
|
||||
#ifdef WAVECARD
|
||||
if (wc_msg_received) {
|
||||
wc_parse_payload();
|
||||
wc_msg_received = FALSE;
|
||||
}
|
||||
#endif
|
||||
if (dl_msg_available) {
|
||||
dl_parse_msg();
|
||||
dl_msg_available = FALSE;
|
||||
|
||||
@@ -121,7 +121,7 @@ SIGNAL(SIG_UART1_TRANS) {
|
||||
void uart0_init( void ) {
|
||||
/* Baudrate is 38.4k */
|
||||
UBRR0H = 0;
|
||||
#ifdef WAVECARD_ON_UART0
|
||||
#ifdef WAVECARD
|
||||
UBRR0L = 103; //9600
|
||||
#else
|
||||
UBRR0L = 25; // 38.4
|
||||
@@ -133,7 +133,7 @@ void uart0_init( void ) {
|
||||
UCSR0B = _BV(RXEN) | _BV(TXEN);
|
||||
/* Set frame format: 8data, 1stop bit */
|
||||
UCSR0C = _BV(UCSZ1) | _BV(UCSZ0);
|
||||
#ifdef WAVECARD_ON_UART0
|
||||
#ifdef WAVECARD
|
||||
/* Enable uart receive interrupt */
|
||||
sbi(UCSR0B, RXCIE );
|
||||
#endif
|
||||
|
||||
@@ -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