AP_InertialSensor: support BOARD_MATCH() for IMUs

This commit is contained in:
Andrew Tridgell 2022-07-19 08:32:27 +10:00
parent 0e745d0ad3
commit 97646f4164

View File

@ -1023,6 +1023,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)