mavlink: make it possible to build with mavlink 1.0 headers

This commit is contained in:
Andrew Tridgell 2011-10-16 18:00:12 +11:00
parent 7cc396bd83
commit de7cf3d1db
2 changed files with 20 additions and 4 deletions

View File

@ -11,7 +11,11 @@ BetterStream *mavlink_comm_1_port;
// this might need to move to the flight software // this might need to move to the flight software
mavlink_system_t mavlink_system = {7,1,0,0}; mavlink_system_t mavlink_system = {7,1,0,0};
#include "include/mavlink_helpers.h" #ifdef MAVLINK10
# include "include_v1.0/mavlink_helpers.h"
#else
# include "include/mavlink_helpers.h"
#endif
uint8_t mavlink_check_target(uint8_t sysid, uint8_t compid) uint8_t mavlink_check_target(uint8_t sysid, uint8_t compid)
{ {

View File

@ -10,13 +10,21 @@
#define MAVLINK_SEPARATE_HELPERS #define MAVLINK_SEPARATE_HELPERS
#include "include/ardupilotmega/version.h" #ifdef MAVLINK10
# include "include_v1.0/ardupilotmega/version.h"
#else
# include "include/ardupilotmega/version.h"
#endif
// this allows us to make mavlink_message_t much smaller // this allows us to make mavlink_message_t much smaller
#define MAVLINK_MAX_PAYLOAD_LEN MAVLINK_MAX_DIALECT_PAYLOAD_SIZE #define MAVLINK_MAX_PAYLOAD_LEN MAVLINK_MAX_DIALECT_PAYLOAD_SIZE
#define MAVLINK_COMM_NUM_BUFFERS 2 #define MAVLINK_COMM_NUM_BUFFERS 2
#include "include/mavlink_types.h" #ifdef MAVLINK10
# include "include_v1.0/mavlink_types.h"
#else
# include "include/mavlink_types.h"
#endif
/// MAVLink stream used for HIL interaction /// MAVLink stream used for HIL interaction
extern BetterStream *mavlink_comm_0_port; extern BetterStream *mavlink_comm_0_port;
@ -109,7 +117,11 @@ static inline int comm_get_txspace(mavlink_channel_t chan)
} }
#define MAVLINK_USE_CONVENIENCE_FUNCTIONS #define MAVLINK_USE_CONVENIENCE_FUNCTIONS
#include "include/ardupilotmega/mavlink.h" #ifdef MAVLINK10
# include "include_v1.0/ardupilotmega/mavlink.h"
#else
# include "include/ardupilotmega/mavlink.h"
#endif
uint8_t mavlink_check_target(uint8_t sysid, uint8_t compid); uint8_t mavlink_check_target(uint8_t sysid, uint8_t compid);