+variables you need to set to define the output port and output baud

This commit is contained in:
Roland Meertens
2015-10-29 15:46:20 +01:00
parent 9e5b9c9cfd
commit 56cb25f98e
3 changed files with 20 additions and 10 deletions
+3 -6
View File
@@ -33,13 +33,10 @@
<modules main_freq="512">
<load name="bat_voltage_ardrone2.xml"/>
<!--load name="uartrotation.xml"/-->
<load name="opticflow_hover.xml"/>
<load name="mavlink_decoder.xml">
<configure name="MAVLINK_PORT" value="UART1"/>
<configure name="MAVLINK_BAUD" value="B115200"/>
<load name="uartrotation.xml">
<configure name="STEREO_UART" value="UART1"/>
<configure name="STEREO_BAUD" value="B115200"/>
</load>
<load name="px4flow.xml"/>
</modules>
<commands>
+16 -3
View File
@@ -3,6 +3,8 @@
<module name="uartrotation">
<doc>
<description>Writes rotation to the uart bus</description>
<configure name="STEREO_UART" value="UARTX" description="Sets the UART port number of the connected camera (required)"/>
<configure name="STEREO_BAUD" value="BXXXXX" description="Sets the BAUD rate of the connected camera (required: must be same as camera)"/>
</doc>
<header>
<file name="uartrotation.h"/>
@@ -11,11 +13,22 @@
<makefile>
<file name="uartrotation.c"/>
<file name="stereoprotocol.c" dir="subsystems"/>
<!-- <define name="USE_$(STEREO_UART)"/>
<define name="UART_LINK" value="$(STEREO_UART_LOWER)"/>
<define name="$(STEREO_UART)_BAUD" value="$(STEREO_BAUD)"/>-->
<raw>
ODROID_GPS_PORT_LOWER=$(shell echo $(GPS_PORT) | tr A-Z a-z)
ap.CFLAGS += -DUSE_$(GPS_PORT) -D$(GPS_PORT)_BAUD=$(GPS_BAUD)
ap.CFLAGS += -DUSE_GPS -DGPS_LINK=$(ODROID_GPS_PORT_LOWER)
STEREO_UART_LOWER=$(shell echo $(STEREO_UART) | tr A-Z a-z)
ap.CFLAGS += -DUSE_$(STEREO_UART)
ap.CFLAGS += -DUART_LINK=$(STEREO_UART_LOWER)
ap.CFLAGS += -D$(STEREO_UART)_BAUD=$(STEREO_BAUD)
</raw>
<!--
ODROID_GPS_PORT_LOWER=$(shell echo $(GPS_PORT) | tr A-Z a-z)
ap.CFLAGS += -DUSE_$(GPS_PORT) -D$(GPS_PORT)_BAUD=$(GPS_BAUD)
ap.CFLAGS += -DUSE_GPS -DGPS_LINK=$(ODROID_GPS_PORT_LOWER)
-->
</makefile>
</module>
@@ -55,7 +55,7 @@ static void write_serial_rot(struct transport_tx *trans, struct link_device *dev
pointer[9]=(int32_t)(state.alt_agl_f*100); //height above ground level in CM.
pointer[10]=frameNumberSending++;
printf("Whoo sending serial\n");
stereoprot_sendArray( &((GPS_LINK).device),ar, lengthArrayInformation, 1);
stereoprot_sendArray( &((UART_LINK).device),ar, lengthArrayInformation, 1);
printf("Whoo sending serial2\n");
}