Browse Source

AP_RangeFinder: correct creation/use of TFMINI_ADDR_DEFAULT

Named incorrectly and defined in wrong file...
apm_2208
Peter Barker 3 years ago committed by Andrew Tridgell
parent
commit
deba0b712b
  1. 2
      libraries/AP_RangeFinder/AP_RangeFinder.cpp
  2. 2
      libraries/AP_RangeFinder/AP_RangeFinder_Benewake_TFMini.h
  3. 2
      libraries/AP_RangeFinder/AP_RangeFinder_Benewake_TFMiniPlus.h

2
libraries/AP_RangeFinder/AP_RangeFinder.cpp

@ -432,7 +432,7 @@ void RangeFinder::detect_instance(uint8_t instance, uint8_t& serial_instance)
break; break;
case Type::BenewakeTFminiPlus: { case Type::BenewakeTFminiPlus: {
#if AP_RANGEFINDER_BENEWAKE_TFMINIPLUS_ENABLED #if AP_RANGEFINDER_BENEWAKE_TFMINIPLUS_ENABLED
uint8_t addr = TFMINI_ADDR_DEFAULT; uint8_t addr = TFMINIPLUS_ADDR_DEFAULT;
if (params[instance].address != 0) { if (params[instance].address != 0) {
addr = params[instance].address; addr = params[instance].address;
} }

2
libraries/AP_RangeFinder/AP_RangeFinder_Benewake_TFMini.h

@ -8,8 +8,6 @@
#if AP_RANGEFINDER_BENEWAKE_TFMINI_ENABLED #if AP_RANGEFINDER_BENEWAKE_TFMINI_ENABLED
#define TFMINI_ADDR_DEFAULT 0x10 // TFMini default device id
class AP_RangeFinder_Benewake_TFMini : public AP_RangeFinder_Benewake class AP_RangeFinder_Benewake_TFMini : public AP_RangeFinder_Benewake
{ {
public: public:

2
libraries/AP_RangeFinder/AP_RangeFinder_Benewake_TFMiniPlus.h

@ -25,6 +25,8 @@
#if AP_RANGEFINDER_BENEWAKE_TFMINIPLUS_ENABLED #if AP_RANGEFINDER_BENEWAKE_TFMINIPLUS_ENABLED
#define TFMINIPLUS_ADDR_DEFAULT 0x10 // TFMini default device id
#include <AP_HAL/utility/sparse-endian.h> #include <AP_HAL/utility/sparse-endian.h>
#include <AP_HAL/I2CDevice.h> #include <AP_HAL/I2CDevice.h>

Loading…
Cancel
Save