Plane: start port of main ArduPlane code to AP_HAL_PX4

This commit is contained in:
Andrew Tridgell 2013-01-02 12:50:42 +11:00
parent b9594e7123
commit 1a49549e3e
2 changed files with 18 additions and 3 deletions

View File

@ -70,6 +70,7 @@
#include <AP_HAL_AVR.h>
#include <AP_HAL_AVR_SITL.h>
#include <AP_HAL_PX4.h>
#include <AP_HAL_Empty.h>
AP_HAL::BetterStream* cliSerial;
@ -111,6 +112,9 @@ DataFlash_APM1 DataFlash;
DataFlash_APM2 DataFlash;
#elif CONFIG_HAL_BOARD == HAL_BOARD_AVR_SITL
DataFlash_SITL DataFlash;
#else
// no dataflash driver
DataFlash_Empty DataFlash;
#endif
////////////////////////////////////////////////////////////////////////////////
@ -919,10 +923,10 @@ static void slow_loop()
case 1:
slow_loopCounter++;
#if CONFIG_HAL_BOARD == HAL_BOARD_APM1 || CONFIG_HAL_BOARD == HAL_BOARD_AVR_SITL
update_aux_servo_function(&g.rc_5, &g.rc_6, &g.rc_7, &g.rc_8);
#else
#if CONFIG_HAL_BOARD == HAL_BOARD_APM2
update_aux_servo_function(&g.rc_5, &g.rc_6, &g.rc_7, &g.rc_8, &g.rc_9, &g.rc_10, &g.rc_11);
#else
update_aux_servo_function(&g.rc_5, &g.rc_6, &g.rc_7, &g.rc_8);
#endif
enable_aux_servos();

View File

@ -133,6 +133,17 @@
# define CONFIG_INS_TYPE CONFIG_INS_STUB
# define CONFIG_PITOT_SOURCE PITOT_SOURCE_ANALOG_PIN
# define MAGNETOMETER ENABLED
#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 BATTERY_VOLT_PIN -1
# define BATTERY_CURR_PIN -1
# define CONFIG_INS_TYPE CONFIG_INS_STUB
# define CONFIG_PITOT_SOURCE PITOT_SOURCE_ANALOG_PIN
# define MAGNETOMETER ENABLED
#endif