AP_OpticalFlow: move bus definition to AP_HAL header

This commit is contained in:
Lucas De Marchi 2016-04-29 12:10:21 -03:00
parent 46fb57fcf1
commit 5a52533084
2 changed files with 5 additions and 1 deletions

View File

@ -431,6 +431,10 @@
#define HAL_OPTFLOW_PX4FLOW_I2C_ADDRESS 0x42
#endif
#ifndef HAL_OPTFLOW_PX4FLOW_I2C_BUS
#define HAL_OPTFLOW_PX4FLOW_I2C_BUS 1
#endif
#elif CONFIG_HAL_BOARD == HAL_BOARD_EMPTY
#define HAL_BOARD_NAME "EMPTY"
#define HAL_CPU_CLASS HAL_CPU_CLASS_16

View File

@ -51,7 +51,7 @@ OpticalFlow::OpticalFlow(AP_AHRS_NavEKF& ahrs) :
CONFIG_HAL_BOARD_SUBTYPE == HAL_BOARD_SUBTYPE_LINUX_BBBMINI
backend(new AP_OpticalFlow_Onboard(*this, ahrs)),
#elif CONFIG_HAL_BOARD == HAL_BOARD_LINUX
backend(new AP_OpticalFlow_Linux(*this, hal.i2c_mgr->get_device(1, HAL_OPTFLOW_PX4FLOW_I2C_ADDRESS))),
backend(new AP_OpticalFlow_Linux(*this, hal.i2c_mgr->get_device(HAL_OPTFLOW_PX4FLOW_I2C_BUS, HAL_OPTFLOW_PX4FLOW_I2C_ADDRESS))),
#else
backend(NULL),
#endif