mirror of
https://github.com/paparazzi/paparazzi.git
synced 2026-05-31 20:38:27 +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="THETA0" value="45" unit="deg"/>
|
||||||
<define name="PHI0" value="-45" unit="deg"/>
|
<define name="PHI0" value="-45" unit="deg"/>
|
||||||
</section>
|
</section>
|
||||||
|
<makefile>
|
||||||
|
LOCAL_CFLAGS += -DWAVECARD_ON_UART0
|
||||||
|
$(TARGET).srcs += wavecard.c
|
||||||
|
</makefile>
|
||||||
</airframe>
|
</airframe>
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
#
|
#
|
||||||
# $Id$
|
# $Id$
|
||||||
# Copyright (C) 2003 Pascal Brisset, Antoine Drouin
|
# Copyright (C) 2003-2005 Pascal Brisset, Antoine Drouin
|
||||||
#
|
#
|
||||||
# This file is part of paparazzi.
|
# This file is part of paparazzi.
|
||||||
#
|
#
|
||||||
@@ -24,7 +24,7 @@
|
|||||||
FBW=../fly_by_wire
|
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
|
VARINCLUDE=$(PAPARAZZI_HOME)/var/include
|
||||||
ACINCLUDE = $(PAPARAZZI_HOME)/var/$(AIRCRAFT)
|
ACINCLUDE = $(PAPARAZZI_HOME)/var/$(AIRCRAFT)
|
||||||
@@ -63,8 +63,7 @@ $(TARGET).srcs = \
|
|||||||
mainloop.c \
|
mainloop.c \
|
||||||
cam.c \
|
cam.c \
|
||||||
traffic_info.c \
|
traffic_info.c \
|
||||||
datalink.c \
|
datalink.c
|
||||||
wavecard.c
|
|
||||||
|
|
||||||
ifeq ($(AIRCRAFT), Gorazoptere_brushless_ANALOG)
|
ifeq ($(AIRCRAFT), Gorazoptere_brushless_ANALOG)
|
||||||
$(TARGET).srcs += ahrs.S
|
$(TARGET).srcs += ahrs.S
|
||||||
@@ -77,6 +76,7 @@ ifeq ($(AIRCRAFT), quadRotorJP)
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
|
|
||||||
|
include $(PAPARAZZI_HOME)/var/$(AIRCRAFT)/Makefile.ac
|
||||||
include ../../../conf/Makefile.local
|
include ../../../conf/Makefile.local
|
||||||
include ../../../conf/Makefile.avr
|
include ../../../conf/Makefile.avr
|
||||||
|
|
||||||
|
|||||||
@@ -72,7 +72,7 @@ int main( void ) {
|
|||||||
nav_init();
|
nav_init();
|
||||||
ir_init();
|
ir_init();
|
||||||
estimator_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();
|
uart0_init();
|
||||||
#endif //SECTION_IMU
|
#endif //SECTION_IMU
|
||||||
/** - start interrupt task */
|
/** - start interrupt task */
|
||||||
@@ -114,10 +114,12 @@ int main( void ) {
|
|||||||
gps_pos_available = FALSE;
|
gps_pos_available = FALSE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#ifdef WAVECARD
|
||||||
if (wc_msg_received) {
|
if (wc_msg_received) {
|
||||||
wc_parse_payload();
|
wc_parse_payload();
|
||||||
wc_msg_received = FALSE;
|
wc_msg_received = FALSE;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
if (dl_msg_available) {
|
if (dl_msg_available) {
|
||||||
dl_parse_msg();
|
dl_parse_msg();
|
||||||
dl_msg_available = FALSE;
|
dl_msg_available = FALSE;
|
||||||
|
|||||||
@@ -121,7 +121,7 @@ SIGNAL(SIG_UART1_TRANS) {
|
|||||||
void uart0_init( void ) {
|
void uart0_init( void ) {
|
||||||
/* Baudrate is 38.4k */
|
/* Baudrate is 38.4k */
|
||||||
UBRR0H = 0;
|
UBRR0H = 0;
|
||||||
#ifdef WAVECARD_ON_UART0
|
#ifdef WAVECARD
|
||||||
UBRR0L = 103; //9600
|
UBRR0L = 103; //9600
|
||||||
#else
|
#else
|
||||||
UBRR0L = 25; // 38.4
|
UBRR0L = 25; // 38.4
|
||||||
@@ -133,7 +133,7 @@ void uart0_init( void ) {
|
|||||||
UCSR0B = _BV(RXEN) | _BV(TXEN);
|
UCSR0B = _BV(RXEN) | _BV(TXEN);
|
||||||
/* Set frame format: 8data, 1stop bit */
|
/* Set frame format: 8data, 1stop bit */
|
||||||
UCSR0C = _BV(UCSZ1) | _BV(UCSZ0);
|
UCSR0C = _BV(UCSZ1) | _BV(UCSZ0);
|
||||||
#ifdef WAVECARD_ON_UART0
|
#ifdef WAVECARD
|
||||||
/* Enable uart receive interrupt */
|
/* Enable uart receive interrupt */
|
||||||
sbi(UCSR0B, RXCIE );
|
sbi(UCSR0B, RXCIE );
|
||||||
#endif
|
#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
|
printf " int16_t _var_%s = %s;\\\n" var v
|
||||||
| _ -> xml_error "set|let"
|
| _ -> xml_error "set|let"
|
||||||
|
|
||||||
|
|
||||||
let parse_section = fun s ->
|
let parse_section = fun s ->
|
||||||
match Xml.tag s with
|
match Xml.tag s with
|
||||||
"section" ->
|
"section" ->
|
||||||
@@ -140,6 +141,9 @@ let parse_section = fun s ->
|
|||||||
printf " uint16_t servo_value;\\\n";
|
printf " uint16_t servo_value;\\\n";
|
||||||
List.iter parse_command (Xml.children s);
|
List.iter parse_command (Xml.children s);
|
||||||
printf "}\n"
|
printf "}\n"
|
||||||
|
| "makefile" ->
|
||||||
|
()
|
||||||
|
(** Ignoring this section *)
|
||||||
| _ -> xml_error "param|servos|command"
|
| _ -> xml_error "param|servos|command"
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user