Copter: fixed build on px4

This commit is contained in:
Andrew Tridgell 2013-01-02 22:08:40 +11:00
parent 2294acc652
commit 94e3322e24
3 changed files with 24 additions and 2 deletions

View File

@ -67,6 +67,7 @@
#include <AP_HAL.h> #include <AP_HAL.h>
#include <AP_HAL_AVR.h> #include <AP_HAL_AVR.h>
#include <AP_HAL_AVR_SITL.h> #include <AP_HAL_AVR_SITL.h>
#include <AP_HAL_PX4.h>
#include <AP_HAL_Empty.h> #include <AP_HAL_Empty.h>
// Application dependencies // Application dependencies
@ -151,6 +152,8 @@ DataFlash_APM2 DataFlash;
DataFlash_APM1 DataFlash; DataFlash_APM1 DataFlash;
#elif CONFIG_HAL_BOARD == HAL_BOARD_AVR_SITL #elif CONFIG_HAL_BOARD == HAL_BOARD_AVR_SITL
DataFlash_SITL DataFlash; DataFlash_SITL DataFlash;
#else
DataFlash_Empty DataFlash;
#endif #endif

View File

@ -218,7 +218,7 @@ static NOINLINE void send_extended_status1(mavlink_channel_t chan, uint16_t pack
static void NOINLINE send_meminfo(mavlink_channel_t chan) static void NOINLINE send_meminfo(mavlink_channel_t chan)
{ {
#if CONFIG_HAL_BOARD != HAL_BOARD_AVR_SITL #if CONFIG_HAL_BOARD == HAL_BOARD_APM1 || CONFIG_HAL_BOARD == HAL_BOARD_APM2
extern unsigned __brkval; extern unsigned __brkval;
mavlink_msg_meminfo_send(chan, __brkval, memcheck_available_memory()); mavlink_msg_meminfo_send(chan, __brkval, memcheck_available_memory());
#endif #endif

View File

@ -71,6 +71,13 @@
# define MAG_ORIENTATION AP_COMPASS_COMPONENTS_DOWN_PINS_FORWARD # define MAG_ORIENTATION AP_COMPASS_COMPONENTS_DOWN_PINS_FORWARD
# define CONFIG_SONAR_SOURCE SONAR_SOURCE_ANALOG_PIN # define CONFIG_SONAR_SOURCE SONAR_SOURCE_ANALOG_PIN
# define MAGNETOMETER ENABLED # define MAGNETOMETER ENABLED
#elif CONFIG_HAL_BOARD == HAL_BOARD_PX4
# define CONFIG_IMU_TYPE CONFIG_IMU_SITL
# define CONFIG_PUSHBUTTON DISABLED
# define CONFIG_RELAY DISABLED
# define MAG_ORIENTATION AP_COMPASS_COMPONENTS_DOWN_PINS_FORWARD
# define CONFIG_SONAR_SOURCE SONAR_SOURCE_ANALOG_PIN
# define MAGNETOMETER ENABLED
#endif #endif
////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////
@ -180,6 +187,18 @@
# define USB_MUX_PIN -1 # define USB_MUX_PIN -1
# define BATTERY_VOLT_PIN 1 // Battery voltage on A1 # define BATTERY_VOLT_PIN 1 // Battery voltage on A1
# define BATTERY_CURR_PIN 2 // Battery current on A2 # define BATTERY_CURR_PIN 2 // Battery current on A2
#elif CONFIG_HAL_BOARD == HAL_BOARD_PX4
# define A_LED_PIN 27
# define B_LED_PIN 26
# define C_LED_PIN 25
# define LED_ON LOW
# define LED_OFF HIGH
# define SLIDE_SWITCH_PIN (-1)
# define PUSHBUTTON_PIN (-1)
# define CLI_SLIDER_ENABLED DISABLED
# define USB_MUX_PIN -1
# define BATTERY_VOLT_PIN -1
# define BATTERY_CURR_PIN -1
#endif #endif
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
@ -202,7 +221,7 @@
#define COPTER_LED_6 AN9 // Motor LED #define COPTER_LED_6 AN9 // Motor LED
#define COPTER_LED_7 AN10 // Motor LED #define COPTER_LED_7 AN10 // Motor LED
#define COPTER_LED_8 AN11 // Motor LED #define COPTER_LED_8 AN11 // Motor LED
#elif CONFIG_HAL_BOARD == HAL_BOARD_APM1 || CONFIG_HAL_BOARD == HAL_BOARD_AVR_SITL #elif CONFIG_HAL_BOARD == HAL_BOARD_APM1 || CONFIG_HAL_BOARD == HAL_BOARD_AVR_SITL || CONFIG_HAL_BOARD == HAL_BOARD_PX4
#define COPTER_LED_1 AN8 // Motor or Aux LED #define COPTER_LED_1 AN8 // Motor or Aux LED
#define COPTER_LED_2 AN9 // Motor LED #define COPTER_LED_2 AN9 // Motor LED
#define COPTER_LED_3 AN10 // Motor or GPS LED #define COPTER_LED_3 AN10 // Motor or GPS LED