From db36ef34336a39f789f29cbe01d2f195ae0fe167 Mon Sep 17 00:00:00 2001 From: Peter Barker Date: Fri, 1 Nov 2019 14:03:24 +1100 Subject: [PATCH] Sub: use enum-class for RangeFinder type --- ArduSub/Parameters.cpp | 2 +- libraries/AP_RangeFinder/RangeFinder.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ArduSub/Parameters.cpp b/ArduSub/Parameters.cpp index 766714c983..d1448233cb 100644 --- a/ArduSub/Parameters.cpp +++ b/ArduSub/Parameters.cpp @@ -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() diff --git a/libraries/AP_RangeFinder/RangeFinder.cpp b/libraries/AP_RangeFinder/RangeFinder.cpp index f4d7d22577..6f9b968f84 100644 --- a/libraries/AP_RangeFinder/RangeFinder.cpp +++ b/libraries/AP_RangeFinder/RangeFinder.cpp @@ -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: