[pprlink] start using pprzlink for airborne code

some stuff are compiling but not working (at least sim)
needs a lot of cleaning
needs a better way to init transport types
This commit is contained in:
Gautier Hattenberger
2015-12-26 23:48:17 +01:00
parent 2d20d6b12b
commit cfbbf0d435
154 changed files with 217 additions and 1680 deletions

3
.gitmodules vendored
View File

@@ -19,3 +19,6 @@
[submodule "sw/ext/mavlink"]
path = sw/ext/mavlink
url = https://github.com/paparazzi/mavlink.git
[submodule "sw/ext/pprzlink"]
path = sw/ext/pprzlink
url = https://github.com/paparazzi/pprzlink.git

View File

@@ -58,6 +58,7 @@ endif
#
LIB=sw/lib
STATICINCLUDE =$(PAPARAZZI_HOME)/var/include
MESSAGES_INSTALL =$(PAPARAZZI_HOME)/var
CONF=$(PAPARAZZI_SRC)/conf
AIRBORNE=sw/airborne
SIMULATOR=sw/simulator
@@ -68,6 +69,7 @@ GENERATORS=$(PAPARAZZI_SRC)/sw/tools/generators
JOYSTICK=sw/ground_segment/joystick
EXT=sw/ext
TOOLS=sw/tools
PPRZLINK_DIR=sw/ext/pprzlink
#
# build some stuff in subdirs
@@ -103,8 +105,8 @@ INTERMCU_MSG_H=$(STATICINCLUDE)/intermcu_msg.h
MAVLINK_DIR=$(STATICINCLUDE)/mavlink/
MAVLINK_PROTOCOL_H=$(MAVLINK_DIR)protocol.h
GEN_HEADERS = $(MESSAGES_H) $(UBX_PROTOCOL_H) $(MTK_PROTOCOL_H) $(XSENS_PROTOCOL_H) $(DL_PROTOCOL_H) $(ABI_MESSAGES_H) $(INTERMCU_MSG_H) $(MAVLINK_PROTOCOL_H)
GEN_HEADERS = $(MESSAGES_H) $(UBX_PROTOCOL_H) $(MTK_PROTOCOL_H) $(XSENS_PROTOCOL_H) $(ABI_MESSAGES_H) $(INTERMCU_MSG_H) $(MAVLINK_PROTOCOL_H)
#$(DL_PROTOCOL_H)
all: ground_segment ext lpctools
@@ -184,16 +186,17 @@ $(PPRZCENTER): libpprz
$(LOGALIZER): libpprz
pprzlink:
@echo BUILD PPRZLINK
$(Q)$(MAKE) -C $(PPRZLINK_DIR) generators
static_h: $(GEN_HEADERS)
$(MESSAGES_H) : $(MESSAGES_XML) generators
$(MESSAGES_H) : $(MESSAGES_XML) pprzlink
$(Q)test -d $(STATICINCLUDE) || mkdir -p $(STATICINCLUDE)
$(Q)test -d $(STATICLIB) || mkdir -p $(STATICLIB)
@echo GENERATE $@
$(eval $@_TMP := $(shell $(MKTEMP)))
$(Q)PAPARAZZI_SRC=$(PAPARAZZI_SRC) PAPARAZZI_HOME=$(PAPARAZZI_HOME) $(GENERATORS)/gen_messages.out $< telemetry > $($@_TMP)
$(Q)mv $($@_TMP) $@
$(Q)chmod a+r $@
$(Q)MESSAGES_INSTALL=$(MESSAGES_INSTALL) $(MAKE) -C $(PPRZLINK_DIR) pymessages
$(MESSAGES2_H) : $(MESSAGES_XML) generators
$(Q)test -d $(STATICINCLUDE) || mkdir -p $(STATICINCLUDE)

View File

@@ -196,7 +196,7 @@ sim.CFLAGS += -DSITL
sim.srcs += $(SRC_ARCH)/sim_ap.c
sim.CFLAGS += -DDOWNLINK -DPERIODIC_TELEMETRY -DDOWNLINK_TRANSPORT=ivy_tp -DDOWNLINK_DEVICE=ivy_tp
sim.srcs += subsystems/datalink/downlink.c $(SRC_FIRMWARE)/datalink.c subsystems/datalink/ivy_transport.c subsystems/datalink/telemetry.c $(SRC_FIRMWARE)/ap_downlink.c $(SRC_FIRMWARE)/fbw_downlink.c
sim.srcs += subsystems/datalink/downlink.c $(SRC_FIRMWARE)/datalink.c $(PAPARAZZI_HOME)/var/lib/pprzlink/ivy_transport.c subsystems/datalink/telemetry.c $(SRC_FIRMWARE)/ap_downlink.c $(SRC_FIRMWARE)/fbw_downlink.c
sim.srcs += $(SRC_ARCH)/sim_gps.c $(SRC_ARCH)/sim_adc_generic.c

View File

@@ -1,3 +1,3 @@
$(TARGET).CFLAGS += -DDOWNLINK -DPERIODIC_TELEMETRY -DDOWNLINK_TRANSPORT=ivy_tp -DDOWNLINK_DEVICE=ivy_tp
$(TARGET).srcs += subsystems/datalink/ivy_transport.c
$(TARGET).srcs += $(PAPARAZZI_HOME)/var/lib/pprzlink/ivy_transport.c
$(TARGET).srcs += subsystems/datalink/downlink.c subsystems/datalink/telemetry.c

View File

@@ -14,4 +14,4 @@ $(TARGET).CFLAGS += -D$(XBEE_MODEM_PORT_UPPER)_BAUD=$(MODEM_BAUD) -DXBEE_BAUD=$(
$(TARGET).CFLAGS += -DDOWNLINK -DPERIODIC_TELEMETRY -DDOWNLINK_DEVICE=$(XBEE_MODEM_PORT_LOWER) -DXBEE_UART=$(XBEE_MODEM_PORT_LOWER)
$(TARGET).CFLAGS += -DDOWNLINK_TRANSPORT=xbee_tp -DDATALINK=XBEE
$(TARGET).srcs += subsystems/datalink/downlink.c subsystems/datalink/xbee.c subsystems/datalink/telemetry.c
$(TARGET).srcs += subsystems/datalink/downlink.c $(PAPARAZZI_HOME)/var/lib/pprzlink/xbee_transport.c subsystems/datalink/telemetry.c

View File

@@ -32,7 +32,7 @@
#define SPI_SLAVE_HS_ARCH_H
#include "std.h"
#include "mcu_periph/link_device.h"
#include "pprzlink/pprzlink_device.h"
struct spi_slave_hs {
/** Generic device interface */

View File

@@ -35,7 +35,7 @@
// Downlink
#include "mcu_periph/uart.h"
#include "messages.h"
#include "pprzlink/messages.h"
#include "subsystems/datalink/downlink.h"
#ifndef IMU_APOGEE_CHAN_X

View File

@@ -36,7 +36,7 @@
#include "subsystems/abi.h"
#include "mcu_periph/uart.h"
#include "messages.h"
#include "pprzlink/messages.h"
#include "subsystems/datalink/downlink.h"
#ifdef BARO_PERIODIC_FREQUENCY

View File

@@ -36,7 +36,7 @@
#include "subsystems/abi.h"
#include "mcu_periph/uart.h"
#include "messages.h"
#include "pprzlink/messages.h"
#include "subsystems/datalink/downlink.h"
#ifdef BARO_PERIODIC_FREQUENCY

View File

@@ -38,7 +38,7 @@
// Downlink
#include "mcu_periph/uart.h"
#include "messages.h"
#include "pprzlink/messages.h"
#include "subsystems/datalink/downlink.h"

View File

@@ -38,7 +38,7 @@
// Downlink
#include "mcu_periph/uart.h"
#include "messages.h"
#include "pprzlink/messages.h"
#include "subsystems/datalink/downlink.h"
#if !defined KROOZ_LOWPASS_FILTER && !defined KROOZ_SMPLRT_DIV

View File

@@ -38,7 +38,7 @@
// Downlink
#include "mcu_periph/uart.h"
#include "messages.h"
#include "pprzlink/messages.h"
#include "subsystems/datalink/downlink.h"

View File

@@ -37,7 +37,7 @@
// Downlink
#include "mcu_periph/uart.h"
#include "messages.h"
#include "pprzlink/messages.h"
#include "subsystems/datalink/downlink.h"

View File

@@ -165,7 +165,7 @@ static inline void autopilot_ClearSettings(float clear)
}
#if DOWNLINK
#include "subsystems/datalink/transport.h"
#include "pprzlink/pprzlink_transport.h"
extern void send_autopilot_version(struct transport_tx *trans, struct link_device *dev);
#endif

View File

@@ -13,7 +13,7 @@
#include "mcu_periph/uart.h"
#include "messages.h"
#include "pprzlink/messages.h"
#include "subsystems/datalink/downlink.h"
#include "generated/settings.h"

View File

@@ -6,7 +6,7 @@
#include "mcu_periph/uart.h"
#include "mcu_arch.h"
#include "messages.h"
#include "pprzlink/messages.h"
#include "subsystems/datalink/downlink.h"
#include "armVIC.h"

View File

@@ -179,7 +179,7 @@ static inline void autopilot_ClearSettings(float clear)
}
#if DOWNLINK
#include "subsystems/datalink/transport.h"
#include "pprzlink/pprzlink_transport.h"
extern void send_autopilot_version(struct transport_tx *trans, struct link_device *dev);
#endif

View File

@@ -34,8 +34,8 @@
#include "generated/settings.h"
#include "subsystems/datalink/downlink.h"
#include "messages.h"
#include "dl_protocol.h"
#include "pprzlink/messages.h"
#include "pprzlink/dl_protocol.h"
#include "mcu_periph/uart.h"
#if defined RADIO_CONTROL && defined RADIO_CONTROL_TYPE_DATALINK

View File

@@ -45,7 +45,7 @@
#include "math/pprz_algebra_int.h"
#include "subsystems/datalink/downlink.h"
#include "messages.h"
#include "pprzlink/messages.h"
#include "mcu_periph/uart.h"
struct EnuCoor_i navigation_target;

View File

@@ -4,7 +4,7 @@
#include "led.h"
#include "mcu_periph/uart.h"
#include "messages.h"
#include "pprzlink/messages.h"
#include "subsystems/datalink/downlink.h"
static inline void main_init(void);

View File

@@ -4,7 +4,7 @@
#include "led.h"
#include "mcu_periph/uart.h"
#include "messages.h"
#include "pprzlink/messages.h"
#include "subsystems/datalink/downlink.h"
static inline void main_init(void);

View File

@@ -4,7 +4,7 @@
#include "led.h"
#include "mcu_periph/usb_serial.h"
#include "messages.h"
#include "pprzlink/messages.h"
#include "subsystems/datalink/downlink.h"
static inline void main_init(void);

View File

@@ -4,12 +4,12 @@
#include "led.h"
#include "mcu_periph/uart.h"
#include "messages.h"
#include "pprzlink/messages.h"
#include "subsystems/datalink/downlink.h"
#include "subsystems/datalink/datalink.h"
#include "generated/settings.h"
#include "dl_protocol.h"
#include "pprzlink/dl_protocol.h"
#include "wt_servo.h"

View File

@@ -4,12 +4,12 @@
#include "led.h"
#include "mcu_periph/uart.h"
#include "messages.h"
#include "pprzlink/messages.h"
#include "subsystems/datalink/downlink.h"
#include "subsystems/datalink/datalink.h"
#include "generated/settings.h"
#include "dl_protocol.h"
#include "pprzlink/dl_protocol.h"
#include "i2c.h"
#include "mb_twi_controller_mkk.h"

View File

@@ -1,58 +0,0 @@
/*
* Copyright (C) 2014 Gautier Hattenberger <gautier.hattenberger@enac.fr>
*
* This file is part of paparazzi.
*
* paparazzi is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
*
* paparazzi is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with paparazzi; see the file COPYING. If not, see
* <http://www.gnu.org/licenses/>.
*
*/
/** \file mcu_periph/link_device.h
* generic device header
*/
#ifndef LINK_DEVICE_H
#define LINK_DEVICE_H
#include <inttypes.h>
/** Function pointers definition
*
* they are used to cast the real functions with the correct type
* to store in the device structure
*/
typedef int (*check_free_space_t)(void *, uint8_t);
typedef void (*put_byte_t)(void *, uint8_t);
typedef void (*send_message_t)(void *);
typedef int (*char_available_t)(void *);
typedef uint8_t (*get_byte_t)(void *);
/** Device structure
*/
struct link_device {
check_free_space_t check_free_space; ///< check if transmit buffer is not full
put_byte_t put_byte; ///< put one byte
send_message_t send_message; ///< send completed buffer
char_available_t char_available; ///< check if a new character is available
get_byte_t get_byte; ///< get a new char
void *periph; ///< pointer to parent implementation
uint16_t nb_msgs; ///< The number of messages send
uint8_t nb_ovrn; ///< The number of overruns
uint32_t nb_bytes; ///< The number of bytes send
};
#endif // LINK_DEVICE_H

View File

@@ -246,6 +246,7 @@ void uart_periph_init(struct uart_periph *p)
p->device.send_message = (send_message_t)null_function;
p->device.char_available = (char_available_t)uart_char_available;
p->device.get_byte = (get_byte_t)uart_getch;
p->device.set_baudrate = (set_baudrate_t)uart_periph_set_baudrate;
#if PERIODIC_TELEMETRY
// the first to register do it for the others

View File

@@ -29,7 +29,7 @@
#define MCU_PERIPH_UART_H
#include "mcu_periph/uart_arch.h"
#include "mcu_periph/link_device.h"
#include "pprzlink/pprzlink_device.h"
#include "std.h"
#ifndef UART_RX_BUFFER_SIZE

View File

@@ -30,7 +30,7 @@
#include "std.h"
#include "mcu_periph/udp_arch.h"
#include "mcu_periph/link_device.h"
#include "pprzlink/pprzlink_device.h"
#define UDP_RX_BUFFER_SIZE 256
#define UDP_TX_BUFFER_SIZE 256

View File

@@ -30,7 +30,7 @@
#include <inttypes.h>
#include "std.h"
#include "mcu_periph/link_device.h"
#include "pprzlink/pprzlink_device.h"
struct usb_serial_periph {
/** Generic device interface */

View File

@@ -1,7 +1,7 @@
#include "adc_generic.h"
#include "mcu_periph/adc.h"
#include "mcu_periph/uart.h"
#include "messages.h"
#include "pprzlink/messages.h"
#include "subsystems/datalink/downlink.h"
#include BOARD_CONFIG

View File

@@ -27,7 +27,7 @@
#include "led.h"
#include "mcu_periph/uart.h"
#include "messages.h"
#include "pprzlink/messages.h"
#include "subsystems/datalink/downlink.h"
#include "max11040.h"
#include "adcs/max11040_hw.h"

View File

@@ -8,7 +8,7 @@
#include "firmwares/fixedwing/guidance/guidance_v.h"
#include "state.h"
#include "messages.h"
#include "pprzlink/messages.h"
#include "subsystems/datalink/downlink.h"
#include "mcu_periph/uart.h"
#include "generated/airframe.h"

View File

@@ -27,7 +27,7 @@
#include "subsystems/imu.h"
#include "subsystems/electrical.h"
#include "messages.h"
#include "pprzlink/messages.h"
#include "mcu_periph/uart.h"
#include "subsystems/datalink/downlink.h"

View File

@@ -59,7 +59,7 @@ void config_mkk_v2_periodic_read_status(void)
}
#include "mcu_periph/uart.h"
#include "messages.h"
#include "pprzlink/messages.h"
#include "subsystems/datalink/downlink.h"

View File

@@ -60,7 +60,7 @@ void init_sysmon(void)
}
#include "mcu_periph/uart.h"
#include "messages.h"
#include "pprzlink/messages.h"
#include "subsystems/datalink/downlink.h"
void periodic_report_sysmon(void)

View File

@@ -29,7 +29,7 @@
#define EXTRA_PPRZ_DL_H
#include "subsystems/datalink/datalink.h"
#include "subsystems/datalink/pprz_transport.h"
#include "pprzlink/pprz_transport.h"
/* PPRZ transport structure */
extern struct pprz_transport extra_pprz_tp;

View File

@@ -34,7 +34,7 @@ uint8_t mavlink_crc_extra[256] = {50, 124, 137, 0, 237, 217, 104, 119, 0, 0, 0,
#if MAVLINK_DECODER_DEBUG
#include "mcu_periph/uart.h"
#include "messages.h"
#include "pprzlink/messages.h"
#include "subsystems/datalink/downlink.h"
void mavlink_send_debug(struct mavlink_transport *t)

View File

@@ -29,7 +29,7 @@
#define MAVLINK_DECODER_H
#include "std.h"
#include "subsystems/datalink/transport.h"
#include "pprzlink/pprzlink_transport.h"
#include "mcu_periph/uart.h"
/* MAVLINK Transport

View File

@@ -33,7 +33,7 @@
#include "mcu_periph/uart.h"
#include "messages.h"
#include "pprzlink/messages.h"
#include "subsystems/datalink/downlink.h"
//from Digi XTend manual

View File

@@ -34,7 +34,7 @@
#include "led.h"
#include "mcu_periph/uart.h"
#include "messages.h"
#include "pprzlink/messages.h"
#include "subsystems/datalink/downlink.h"
// In I2C mode we can not inline this function:

View File

@@ -88,7 +88,7 @@ float dc_autoshoot_period;
uint16_t dc_photo_nr = 0;
#include "mcu_periph/uart.h"
#include "messages.h"
#include "pprzlink/messages.h"
#include "subsystems/datalink/downlink.h"
#include "state.h"
#include "subsystems/gps.h"

View File

@@ -83,7 +83,7 @@ static inline uint16_t pin_of_gpio(uint32_t __attribute__((unused)) port, uint16
#if HACKHD_SYNC_SEND
#include "mcu_periph/uart.h"
#include "messages.h"
#include "pprzlink/messages.h"
#include "subsystems/datalink/downlink.h"
#include "state.h"
#include "subsystems/gps.h"

View File

@@ -31,7 +31,7 @@
#include "mcu_periph/uart.h"
#include "messages.h"
#include "pprzlink/messages.h"
#include "subsystems/datalink/downlink.h"
#include "state.h"

View File

@@ -54,7 +54,7 @@ struct i2c_transaction mppt_trans;
#include "mcu_periph/uart.h"
#include "messages.h"
#include "pprzlink/messages.h"
#include "subsystems/datalink/downlink.h"
uint8_t MPPT_mode;

View File

@@ -22,7 +22,7 @@
#include "modules/energy/MPPT.h"
#include "messages.h"
#include "pprzlink/messages.h"
#include "subsystems/datalink/downlink.h"

View File

@@ -47,7 +47,7 @@ void enose_set_heat(uint8_t no_sensor, uint8_t value)
#include "mcu_periph/uart.h"
#include "messages.h"
#include "pprzlink/messages.h"
#include "subsystems/datalink/downlink.h"
void enose_periodic(void)

View File

@@ -29,7 +29,7 @@
#define GPS_UBX_UCENTER_H
#include "std.h"
#include "mcu_periph/link_device.h"
#include "pprzlink/pprzlink_device.h"
/** U-Center Variables */
#define GPS_UBX_UCENTER_CONFIG_STEPS 19

View File

@@ -26,7 +26,7 @@
#include "mcu_periph/spi.h"
#include "mcu_periph/uart.h"
#include "messages.h"
#include "pprzlink/messages.h"
#include "subsystems/datalink/downlink.h"
//struct qr_code_spi_link_data qr_code_spi_link_data;

View File

@@ -20,7 +20,7 @@
#if CHIMU_DOWNLINK_IMMEDIATE
#include "mcu_periph/uart.h"
#include "messages.h"
#include "pprzlink/messages.h"
#include "subsystems/datalink/downlink.h"
#endif

View File

@@ -16,7 +16,7 @@
#if CHIMU_DOWNLINK_IMMEDIATE
#include "mcu_periph/uart.h"
#include "messages.h"
#include "pprzlink/messages.h"
#include "subsystems/datalink/downlink.h"
#endif

Some files were not shown because too many files have changed in this diff Show More