diff --git a/conf/autopilot/setup.makefile b/conf/autopilot/setup.makefile index 6a95864cde..4d063bcb3e 100644 --- a/conf/autopilot/setup.makefile +++ b/conf/autopilot/setup.makefile @@ -97,11 +97,16 @@ endif # a test program to setup actuators ifeq ($(ARCH), lpc21) -setup_actuators.CFLAGS += -DFBW -DUSE_LED -DSYS_TIME_LED=1 +setup_actuators.CFLAGS += -DFBW -DUSE_LED setup_actuators.CFLAGS += -DUSE_UART1 -DUART1_BAUD=B57600 -DDOWNLINK_DEVICE=Uart1 -DPPRZ_UART=Uart1 setup_actuators.CFLAGS += -DDOWNLINK -DDOWNLINK_TRANSPORT=PprzTransport -DDATALINK=PPRZ setup_actuators.CFLAGS += -DDOWNLINK_FBW_DEVICE=Uart1 -DDOWNLINK_AP_DEVICE=Uart1 setup_actuators.CFLAGS += $(SETUP_INC) -Ifirmwares/fixedwing +ifneq ($(SYS_TIME_LED),none) +setup_actuators.CFLAGS += -DSYS_TIME_LED=$(SYS_TIME_LED) +endif +setup_actuators.CFLAGS += -DPERIODIC_FREQUENCY='60' +setup_actuators.CFLAGS += -DUSE_SYS_TIME setup_actuators.srcs += mcu_periph/sys_time.c $(SRC_ARCH)/mcu_periph/sys_time_arch.c $(SRC_ARCH)/armVIC.c subsystems/datalink/pprz_transport.c subsystems/datalink/downlink.c $(SRC_FIRMWARE)/setup_actuators.c mcu_periph/uart.c $(SRC_ARCH)/mcu_periph/uart_arch.c firmwares/fixedwing/main.c mcu.c $(SRC_ARCH)/mcu_arch.c else ifeq ($(TARGET),setup_actuators) $(error setup_actuators currently only implemented for the lpc21) diff --git a/sw/airborne/firmwares/setup/setup_actuators.c b/sw/airborne/firmwares/setup/setup_actuators.c index c914b1bdc9..a852e928a7 100644 --- a/sw/airborne/firmwares/setup/setup_actuators.c +++ b/sw/airborne/firmwares/setup/setup_actuators.c @@ -7,12 +7,17 @@ #include "generated/airframe.h" #define DATALINK_C #include "subsystems/datalink/datalink.h" -#include "mcu_periph/uart.h" #include "subsystems/datalink/pprz_transport.h" #include "firmwares/fixedwing/main_fbw.h" -#include "subsystems/datalink/downlink.h" + #include "generated/settings.h" +#ifndef DOWNLINK_DEVICE +#define DOWNLINK_DEVICE DOWNLINK_FBW_DEVICE +#endif +#include "mcu_periph/uart.h" +#include "subsystems/datalink/downlink.h" +#include "ap_downlink.h" #define IdOfMsg(x) (x[1]) @@ -76,16 +81,5 @@ void periodic_task_fbw(void) { } void event_task_fbw(void) { - if (PprzBuffer()) { - ReadPprzBuffer(); - } - if (pprz_msg_received) { - pprz_msg_received = FALSE; - pprz_parse_payload(); - LED_TOGGLE(3); - } - if (dl_msg_available) { - dl_parse_msg(); - dl_msg_available = FALSE; - } + DatalinkEvent(); }