AP_RangeFinder: use new ChibiOS driver if user attempts to use PX4 PWM driver

This commit is contained in:
Peter Barker 2018-11-06 16:17:19 +11:00 committed by Andrew Tridgell
parent 186ce80827
commit 6e84a31613
1 changed files with 8 additions and 0 deletions

View File

@ -690,6 +690,14 @@ void RangeFinder::detect_instance(uint8_t instance, uint8_t& serial_instance)
drivers[instance] = new AP_RangeFinder_PX4_PWM(state[instance], _powersave_range, estimated_terrain_height);
}
break;
#elif CONFIG_HAL_BOARD == HAL_BOARD_CHIBIOS
case RangeFinder_TYPE_PX4_PWM:
// to ease moving from PX4 to ChibiOS we'll lie a little about
// the backend driver...
if (AP_RangeFinder_PWM::detect()) {
drivers[instance] = new AP_RangeFinder_PWM(state[instance]);
}
break;
#endif
#if CONFIG_HAL_BOARD_SUBTYPE == HAL_BOARD_SUBTYPE_LINUX_BBBMINI
case RangeFinder_TYPE_BBB_PRU: