AP_InertialSensor: support BOARD_MATCH() for IMUs

This commit is contained in:
Andrew Tridgell 2022-07-19 08:32:27 +10:00
parent bf2c043c23
commit c1022ce4d0

View File

@ -1002,6 +1002,10 @@ AP_InertialSensor::detect_backends(void)
probe_count++; \
} while (0)
// support for adding IMUs conditioned on board type
#define BOARD_MATCH(board_type) AP_BoardConfig::get_board_type()==AP_BoardConfig::board_type
#define ADD_BACKEND_BOARD_MATCH(board_match, x) do { if (board_match) { ADD_BACKEND(x); } } while(0)
// macro for use by HAL_INS_PROBE_LIST
#define GET_I2C_DEVICE(bus, address) hal.i2c_mgr->get_device(bus, address)