Sub: use enum-class for RangeFinder type

This commit is contained in:
Peter Barker 2019-11-01 14:03:24 +11:00 committed by Peter Barker
parent ea26e94f66
commit db36ef3433
2 changed files with 2 additions and 2 deletions

View File

@ -700,7 +700,7 @@ void Sub::load_parameters()
AP_Param::set_default_by_name("MNT_JSTICK_SPD", 100);
AP_Param::set_by_name("MNT_RC_IN_PAN", 7);
AP_Param::set_by_name("MNT_RC_IN_TILT", 8);
AP_Param::set_default_by_name("RNGFND1_TYPE", RangeFinder::RangeFinder_TYPE_MAVLink);
AP_Param::set_default_by_name("RNGFND1_TYPE", (uint8_t)RangeFinder::Type::MAVLink);
}
void Sub::convert_old_parameters()

View File

@ -361,7 +361,7 @@ bool RangeFinder::_add_backend(AP_RangeFinder_Backend *backend)
*/
void RangeFinder::detect_instance(uint8_t instance, uint8_t& serial_instance)
{
const RangeFinder::Type _type = (Type)params[instance].type.get();
const Type _type = (Type)params[instance].type.get();
switch (_type) {
case Type::PLI2C:
case Type::PLI2CV3: