Don't build interface drivers we don't have config for.

This commit is contained in:
px4dev 2013-07-14 12:40:26 -07:00
parent f8f6a43fea
commit b11e05d614
2 changed files with 8 additions and 8 deletions

View File

@ -50,12 +50,9 @@
#include <arch/board/board.h> #include <arch/board/board.h>
#include <nuttx/i2c.h>
#include <drivers/device/i2c.h> #include <drivers/device/i2c.h>
#include <mavlink/mavlink_log.h>
#include "uploader.h" #ifdef PX4_I2C_OBDEV_PX4IO
#include <modules/px4iofirmware/protocol.h>
device::Device *PX4IO_i2c_interface(); device::Device *PX4IO_i2c_interface();
@ -77,10 +74,7 @@ private:
device::Device device::Device
*PX4IO_i2c_interface() *PX4IO_i2c_interface()
{ {
#ifdef PX4_I2C_OBDEV_PX4IO
return new PX4IO_I2C(PX4_I2C_BUS_ONBOARD, PX4_I2C_OBDEV_PX4IO); return new PX4IO_I2C(PX4_I2C_BUS_ONBOARD, PX4_I2C_OBDEV_PX4IO);
#endif
return nullptr;
} }
PX4IO_I2C::PX4IO_I2C(int bus, uint8_t address) : PX4IO_I2C::PX4IO_I2C(int bus, uint8_t address) :
@ -170,3 +164,5 @@ PX4IO_I2C::read(unsigned address, void *data, unsigned count)
ret = count; ret = count;
return ret; return ret;
} }
#endif /* PX4_I2C_OBDEV_PX4IO */

View File

@ -67,6 +67,8 @@
#include <modules/px4iofirmware/protocol.h> #include <modules/px4iofirmware/protocol.h>
#ifdef PX4IO_SERIAL_BASE
device::Device *PX4IO_serial_interface(); device::Device *PX4IO_serial_interface();
/* serial register accessors */ /* serial register accessors */
@ -667,3 +669,5 @@ PX4IO_serial::_abort_dma()
stm32_dmastop(_tx_dma); stm32_dmastop(_tx_dma);
stm32_dmastop(_rx_dma); stm32_dmastop(_rx_dma);
} }
#endif /* PX4IO_SERIAL_BASE */