mirror of
https://github.com/paparazzi/paparazzi.git
synced 2026-06-04 22:17:01 +08:00
[modules] mavlink: easily configure UDP
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
<module name="datalink">
|
||||
<doc>
|
||||
<description>Basic MAVLink implementation</description>
|
||||
<configure name="MAVLINK_PORT" value="UARTx|UDPx" description="The port device to use for mavlink"/>
|
||||
<configure name="MAVLINK_PORT" value="UARTx|UDPx|UsbS" description="The port device to use for mavlink (default: UART1)"/>
|
||||
<configure name="MAVLINK_BAUD" value="B57600" description="Baud rate if MAVLINK_PORT is a UART"/>
|
||||
</doc>
|
||||
<header>
|
||||
@@ -18,18 +18,23 @@
|
||||
<file name="mavlink.c"/>
|
||||
<raw>
|
||||
MAVLINK_PORT ?= UART1
|
||||
MAVLINK_BAUD ?= B57600
|
||||
MAVLINK_PORT_LOWER=$(shell echo $(MAVLINK_PORT) | tr A-Z a-z)
|
||||
MAVLINK_PORT_UPPER=$(shell echo $(MAVLINK_PORT) | tr a-z A-Z)
|
||||
ifeq ($(MAVLINK_PORT), UsbS)
|
||||
ap.CFLAGS += -DUSE_USB_SERIAL
|
||||
ap.srcs += $(SRC_ARCH)/usb_ser_hw.c
|
||||
ap.CFLAGS += -DMAVLINK_DEV=UsbS
|
||||
else
|
||||
ifeq ($(findstring UDP,$(MAVLINK_PORT)), UDP)
|
||||
include $(CFG_SHARED)/udp.makefile
|
||||
$(TARGET).CFLAGS += -DMAVLINK_DEV=$(MAVLINK_PORT_UPPER)
|
||||
$(TARGET).CFLAGS += -DUSE_$(MAVLINK_PORT_UPPER)
|
||||
else
|
||||
MAVLINK_BAUD ?= B57600
|
||||
ap.CFLAGS += -DMAVLINK_DEV=$(MAVLINK_PORT_UPPER)
|
||||
ap.CFLAGS += -DUSE_$(MAVLINK_PORT_UPPER)
|
||||
ap.CFLAGS += -D$(MAVLINK_PORT_UPPER)_BAUD=$(MAVLINK_BAUD)
|
||||
endif
|
||||
endif
|
||||
</raw>
|
||||
</makefile>
|
||||
</module>
|
||||
|
||||
@@ -46,7 +46,7 @@
|
||||
extern mavlink_system_t mavlink_system;
|
||||
|
||||
#ifndef MAVLINK_DEV
|
||||
#define MAVLINK_DEV UDP0
|
||||
#define MAVLINK_DEV UART1
|
||||
#endif
|
||||
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user