From 94e3322e246369af0363f5344dfbfda9d73f8f81 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Wed, 2 Jan 2013 22:08:40 +1100 Subject: [PATCH] Copter: fixed build on px4 --- ArduCopter/ArduCopter.pde | 3 +++ ArduCopter/GCS_Mavlink.pde | 2 +- ArduCopter/config.h | 21 ++++++++++++++++++++- 3 files changed, 24 insertions(+), 2 deletions(-) diff --git a/ArduCopter/ArduCopter.pde b/ArduCopter/ArduCopter.pde index ca97770de7..c9d38ec450 100644 --- a/ArduCopter/ArduCopter.pde +++ b/ArduCopter/ArduCopter.pde @@ -67,6 +67,7 @@ #include #include #include +#include #include // Application dependencies @@ -151,6 +152,8 @@ DataFlash_APM2 DataFlash; DataFlash_APM1 DataFlash; #elif CONFIG_HAL_BOARD == HAL_BOARD_AVR_SITL DataFlash_SITL DataFlash; +#else +DataFlash_Empty DataFlash; #endif diff --git a/ArduCopter/GCS_Mavlink.pde b/ArduCopter/GCS_Mavlink.pde index 16ba221976..02e06cfc18 100644 --- a/ArduCopter/GCS_Mavlink.pde +++ b/ArduCopter/GCS_Mavlink.pde @@ -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) { -#if CONFIG_HAL_BOARD != HAL_BOARD_AVR_SITL +#if CONFIG_HAL_BOARD == HAL_BOARD_APM1 || CONFIG_HAL_BOARD == HAL_BOARD_APM2 extern unsigned __brkval; mavlink_msg_meminfo_send(chan, __brkval, memcheck_available_memory()); #endif diff --git a/ArduCopter/config.h b/ArduCopter/config.h index bdfdc13cd8..b995f5ebf7 100644 --- a/ArduCopter/config.h +++ b/ArduCopter/config.h @@ -71,6 +71,13 @@ # define MAG_ORIENTATION AP_COMPASS_COMPONENTS_DOWN_PINS_FORWARD # define CONFIG_SONAR_SOURCE SONAR_SOURCE_ANALOG_PIN # 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 ////////////////////////////////////////////////////////////////////////////// @@ -180,6 +187,18 @@ # define USB_MUX_PIN -1 # define BATTERY_VOLT_PIN 1 // Battery voltage on A1 # 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 //////////////////////////////////////////////////////////////////////////////// @@ -202,7 +221,7 @@ #define COPTER_LED_6 AN9 // Motor LED #define COPTER_LED_7 AN10 // 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_2 AN9 // Motor LED #define COPTER_LED_3 AN10 // Motor or GPS LED