Browse Source

Add support for baro on aerofc

master
Lucas De Marchi 8 years ago committed by Andrew Tridgell
parent
commit
00c2949dfb
  1. 6
      libraries/AP_Baro/AP_Baro.cpp
  2. 1
      libraries/AP_BoardConfig/px4_drivers.cpp
  3. 4
      libraries/AP_HAL/board/px4.h
  4. 2
      libraries/AP_HAL_PX4/GPIO.cpp

6
libraries/AP_Baro/AP_Baro.cpp

@ -405,6 +405,12 @@ void AP_Baro::init(void) @@ -405,6 +405,12 @@ void AP_Baro::init(void)
std::move(hal.spi->get_device(HAL_BARO_MS5611_SPI_INT_NAME))));
break;
case AP_BoardConfig::PX4_BOARD_AEROFC:
ADD_BACKEND(AP_Baro_MS56XX::probe(*this,
std::move(hal.i2c_mgr->get_device(HAL_BARO_MS5607_I2C_BUS, HAL_BARO_MS5607_I2C_ADDR)),
AP_Baro_MS56XX::BARO_MS5607));
break;
default:
drivers[0] = new AP_Baro_PX4(*this);
_num_drivers = 1;

1
libraries/AP_BoardConfig/px4_drivers.cpp

@ -324,6 +324,7 @@ void AP_BoardConfig::px4_setup_drivers(void) @@ -324,6 +324,7 @@ void AP_BoardConfig::px4_setup_drivers(void)
case PX4_BOARD_PHMINI:
case PX4_BOARD_AUAV21:
case PX4_BOARD_PH2SLIM:
case PX4_BOARD_AEROFC:
break;
default:
px4_sensor_error("Unknown board type");

4
libraries/AP_HAL/board/px4.h

@ -76,3 +76,7 @@ @@ -76,3 +76,7 @@
#define HAL_BARO_MS5611_I2C_BUS 0
#endif
#ifdef CONFIG_ARCH_BOARD_AEROFC_V1
#define HAL_BARO_MS5607_I2C_ADDR 0x77
#define HAL_BARO_MS5607_I2C_BUS 0
#endif

2
libraries/AP_HAL_PX4/GPIO.cpp

@ -46,6 +46,7 @@ void PX4GPIO::init() @@ -46,6 +46,7 @@ void PX4GPIO::init()
}
#endif
#endif
#if !defined(CONFIG_ARCH_BOARD_AEROFC_V1)
_tone_alarm_fd = open(TONEALARM0_DEVICE_PATH, O_WRONLY);
if (_tone_alarm_fd == -1) {
AP_HAL::panic("Unable to open " TONEALARM0_DEVICE_PATH);
@ -55,6 +56,7 @@ void PX4GPIO::init() @@ -55,6 +56,7 @@ void PX4GPIO::init()
if (_gpio_fmu_fd == -1) {
AP_HAL::panic("Unable to open GPIO");
}
#endif
#ifdef CONFIG_ARCH_BOARD_PX4FMU_V1
if (ioctl(_gpio_fmu_fd, GPIO_CLEAR, GPIO_EXT_1) != 0) {
hal.console->printf("GPIO: Unable to setup GPIO_1\n");

Loading…
Cancel
Save