mirror of
https://github.com/paparazzi/paparazzi.git
synced 2026-05-31 20:38:27 +08:00
minor intermcu/led cleanup
This commit is contained in:
@@ -24,7 +24,7 @@ HARD_FLOAT=yes
|
||||
FLASH_MODE ?= PX4_BOOTLOADER
|
||||
PX4_PROTOTYPE ?= "${PAPARAZZI_HOME}/sw/tools/px4/px4fmu-v2.prototype"
|
||||
PX4_BL_PORT ?= "/dev/serial/by-id/usb-3D_Robotics*,/dev/serial/by-id/pci-3D_Robotics*"
|
||||
$(TARGET).MAKEFILE = stm32
|
||||
|
||||
|
||||
#
|
||||
# default LED configuration
|
||||
|
||||
@@ -20,7 +20,7 @@ PX4_BL_PORT ?= "/dev/serial/by-id/usb-FTDI_*"
|
||||
PX4_PROTOTYPE ?= "${PAPARAZZI_HOME}/sw/tools/px4/px4io-v2.prototype"
|
||||
|
||||
FLASH_MODE ?= PX4_BOOTLOADER
|
||||
$(TARGET).MAKEFILE = stm32
|
||||
|
||||
|
||||
#
|
||||
# default LED configuration
|
||||
|
||||
@@ -7,15 +7,22 @@ ifeq (,$(findstring $(SEPARATE_FBW),1 TRUE))
|
||||
$(error Using intermcu via UART, so dual mcu with separate fbw. Please add <configure name="SEPARATE_FBW" value="1"/>)
|
||||
endif
|
||||
|
||||
FBW_MODE_LED ?= none
|
||||
INTERMCU_BAUD ?= B57600
|
||||
|
||||
ifeq ($(TARGET),fbw)
|
||||
INTERMCU_PORT ?= UART2
|
||||
INTERMCU_PORT_LOWER = $(shell echo $(INTERMCU_PORT) | tr A-Z a-z)
|
||||
fbw.CFLAGS += -DINTERMCU_LINK=$(INTERMCU_PORT_LOWER) -DUSE_$(INTERMCU_PORT) -D$(INTERMCU_PORT)_BAUD=B57600
|
||||
INTERMCU_PORT_UPPER = $(shell echo $(INTERMCU_PORT) | tr a-z A-Z)
|
||||
fbw.CFLAGS += -DINTERMCU_LINK=$(INTERMCU_PORT_LOWER) -DUSE_$(INTERMCU_PORT_UPPER) -D$(INTERMCU_PORT_UPPER)_BAUD=$(INTERMCU_BAUD)
|
||||
ifneq ($(FBW_MODE_LED),none)
|
||||
fbw.CFLAGS += -DFBW_MODE_LED=$(FBW_MODE_LED)
|
||||
endif
|
||||
else
|
||||
INTERMCU_PORT ?= UART5
|
||||
INTERMCU_PORT_LOWER = $(shell echo $(INTERMCU_PORT) | tr A-Z a-z)
|
||||
ap.CFLAGS += -DINTERMCU_LINK=$(INTERMCU_PORT_LOWER) -DUSE_$(INTERMCU_PORT) -D$(INTERMCU_PORT)_BAUD=B57600
|
||||
INTERMCU_PORT_UPPER = $(shell echo $(INTERMCU_PORT) | tr a-z A-Z)
|
||||
ap.CFLAGS += -DINTERMCU_LINK=$(INTERMCU_PORT_LOWER) -DUSE_$(INTERMCU_PORT_UPPER) -D$(INTERMCU_PORT_UPPER)_BAUD=$(INTERMCU_BAUD)
|
||||
endif
|
||||
|
||||
ifneq ($(TARGET),sim)
|
||||
|
||||
@@ -2,28 +2,32 @@
|
||||
|
||||
# InterMCU type UART
|
||||
|
||||
FBW_MODE_LED ?= none
|
||||
INTERMCU_PORT ?= UART3
|
||||
INTERMCU_BAUD ?= B230400
|
||||
|
||||
INTERMCU_PORT_LOWER = $(shell echo $(INTERMCU_PORT) | tr A-Z a-z)
|
||||
INTERMCU_PORT_UPPER = $(shell echo $(INTERMCU_PORT) | tr a-z A-Z)
|
||||
|
||||
ifeq ($(TARGET),fbw)
|
||||
INTERMCU_PORT ?= UART3
|
||||
INTERMCU_BAUD ?= B230400
|
||||
INTERMCU_PORT_LOWER = $(shell echo $(INTERMCU_PORT) | tr A-Z a-z)
|
||||
fbw.CFLAGS += -DINTERMCU_LINK=$(INTERMCU_PORT_LOWER) -DUSE_$(INTERMCU_PORT) -D$(INTERMCU_PORT)_BAUD=$(INTERMCU_BAUD)
|
||||
fbw.CFLAGS += -DINTERMCU_LINK=$(INTERMCU_PORT_LOWER)
|
||||
fbw.CFLAGS += -DUSE_$(INTERMCU_PORT_UPPER) -D$(INTERMCU_PORT_UPPER)_BAUD=$(INTERMCU_BAUD)
|
||||
fbw.CFLAGS += -DINTER_MCU_FBW -DDOWNLINK
|
||||
ifneq ($(FBW_MODE_LED),none)
|
||||
fbw.CFLAGS += -DFBW_MODE_LED=$(FBW_MODE_LED)
|
||||
endif
|
||||
fbw.srcs += pprzlink/src/pprz_transport.c
|
||||
fbw.srcs += subsystems/intermcu/intermcu_fbw.c
|
||||
else
|
||||
INTERMCU_PORT ?= UART3
|
||||
INTERMCU_BAUD ?= B230400
|
||||
INTERMCU_PORT_LOWER = $(shell echo $(INTERMCU_PORT) | tr A-Z a-z)
|
||||
ap.CFLAGS += -DINTER_MCU_AP -DINTERMCU_LINK=$(INTERMCU_PORT_LOWER)
|
||||
ap.CFLAGS += -DUSE_$(INTERMCU_PORT) -D$(INTERMCU_PORT)_BAUD=$(INTERMCU_BAUD)
|
||||
ap.CFLAGS += -DUSE_$(INTERMCU_PORT_UPPER) -D$(INTERMCU_PORT_UPPER)_BAUD=$(INTERMCU_BAUD)
|
||||
$(TARGET).CFLAGS += -DRADIO_CONTROL_TYPE_H=\"subsystems/intermcu/intermcu_ap.h\" -DRADIO_CONTROL
|
||||
RADIO_CONTROL_LED ?= none
|
||||
ifneq ($(RADIO_CONTROL_LED),none)
|
||||
$(TARGET).CFLAGS += -DRADIO_CONTROL_LED=$(RADIO_CONTROL_LED)
|
||||
endif
|
||||
|
||||
ap.srcs += subsystems/intermcu/intermcu_ap.c
|
||||
ap.srcs += pprzlink/src/pprz_transport.c
|
||||
$(TARGET).srcs += subsystems/radio_control.c
|
||||
ap.srcs += subsystems/intermcu/intermcu_ap.c
|
||||
ap.srcs += pprzlink/src/pprz_transport.c
|
||||
$(TARGET).srcs += subsystems/radio_control.c
|
||||
endif
|
||||
|
||||
@@ -182,7 +182,9 @@ static inline void checkPx4RebootCommand(unsigned char b)
|
||||
return;
|
||||
}
|
||||
|
||||
#ifdef SYS_TIME_LED
|
||||
LED_ON(SYS_TIME_LED);
|
||||
#endif
|
||||
|
||||
if (b == px4RebootSequence[px4RebootSequenceCount]) {
|
||||
px4RebootSequenceCount++;
|
||||
@@ -202,9 +204,16 @@ static inline void checkPx4RebootCommand(unsigned char b)
|
||||
intermcu_device->put_byte(intermcu_device->periph,
|
||||
0x66); // dummy byte, seems to be necessary otherwise one byte is missing at the fmu side...
|
||||
|
||||
while (((struct uart_periph *)(intermcu_device->periph))->tx_running) {LED_TOGGLE(SYS_TIME_LED);} // tx_running is volatile now, so LED_TOGGLE not necessary anymore
|
||||
while (((struct uart_periph *)(intermcu_device->periph))->tx_running) {
|
||||
// tx_running is volatile now, so LED_TOGGLE not necessary anymore
|
||||
#ifdef SYS_TIME_LED
|
||||
LED_TOGGLE(SYS_TIME_LED);
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifdef SYS_TIME_LED
|
||||
LED_OFF(SYS_TIME_LED);
|
||||
#endif
|
||||
scb_reset_system();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user