[modules] mavlink: more flexible MAVLINK_PORT configure options

This commit is contained in:
Felix Ruess
2015-03-25 16:03:57 +01:00
parent 760dc14f7a
commit 6f4c7b7a98
+2 -2
View File
@@ -20,12 +20,12 @@
MAVLINK_PORT ?= UART1
MAVLINK_PORT_UPPER=$(shell echo $(MAVLINK_PORT) | tr a-z A-Z)
MAVLINK_PORT_LOWER=$(shell echo $(MAVLINK_PORT) | tr A-Z a-z)
ifeq ($(MAVLINK_PORT), UsbS)
ifneq (,$(findstring usb,$(MAVLINK_PORT_LOWER)))
ap.CFLAGS += -DUSE_USB_SERIAL
ap.srcs += $(SRC_ARCH)/usb_ser_hw.c
ap.CFLAGS += -DMAVLINK_DEV=usb_serial
else
ifeq ($(findstring UDP,$(MAVLINK_PORT)), UDP)
ifneq (,$(findstring udp,$(MAVLINK_PORT_LOWER)))
include $(CFG_SHARED)/udp.makefile
$(TARGET).CFLAGS += -DMAVLINK_DEV=$(MAVLINK_PORT_LOWER)
$(TARGET).CFLAGS += -DUSE_$(MAVLINK_PORT_UPPER)