Browse Source

AP_RangeFinder: allow separate enable of MSP rangefinder

zr-v5.1
Andrew Tridgell 4 years ago
parent
commit
34430e9d6c
  1. 2
      libraries/AP_RangeFinder/AP_RangeFinder.h
  2. 2
      libraries/AP_RangeFinder/AP_RangeFinder_Backend.h
  3. 5
      libraries/AP_RangeFinder/AP_RangeFinder_MSP.cpp
  4. 5
      libraries/AP_RangeFinder/AP_RangeFinder_MSP.h

2
libraries/AP_RangeFinder/AP_RangeFinder.h

@ -143,7 +143,7 @@ public: @@ -143,7 +143,7 @@ public:
#if HAL_MSP_RANGEFINDER_ENABLED
// Handle an incoming DISTANCE_SENSOR message (from a MSP enabled range finder)
void handle_msp(const MSP::msp_rangefinder_sensor_t &pkt);
#endif //HAL_MSP_RANGEFINDER_ENABLED
#endif
// return true if we have a range finder with the specified orientation
bool has_orientation(enum Rotation orientation) const;

2
libraries/AP_RangeFinder/AP_RangeFinder_Backend.h

@ -32,7 +32,7 @@ public: @@ -32,7 +32,7 @@ public:
virtual void update() = 0;
virtual void handle_msg(const mavlink_message_t &msg) { return; }
#if HAL_MSP_ENABLED
#if HAL_MSP_RANGEFINDER_ENABLED
virtual void handle_msp(const MSP::msp_rangefinder_sensor_t &pkt) { return; }
#endif

5
libraries/AP_RangeFinder/AP_RangeFinder_MSP.cpp

@ -16,7 +16,7 @@ @@ -16,7 +16,7 @@
#include "AP_RangeFinder_MSP.h"
#include <AP_HAL/AP_HAL.h>
#if HAL_MSP_ENABLED
#if HAL_MSP_RANGEFINDER_ENABLED
extern const AP_HAL::HAL& hal;
@ -68,4 +68,5 @@ void AP_RangeFinder_MSP::update(void) @@ -68,4 +68,5 @@ void AP_RangeFinder_MSP::update(void)
}
}
#endif //HAL_MSP_ENABLED
#endif //HAL_MSP_RANGEFINDER_ENABLED

5
libraries/AP_RangeFinder/AP_RangeFinder_MSP.h

@ -3,7 +3,7 @@ @@ -3,7 +3,7 @@
#include "AP_RangeFinder.h"
#include "AP_RangeFinder_Backend.h"
#if HAL_MSP_ENABLED
#if HAL_MSP_RANGEFINDER_ENABLED
// Data timeout
#define AP_RANGEFINDER_MSP_TIMEOUT_MS 500
@ -38,4 +38,5 @@ private: @@ -38,4 +38,5 @@ private:
static bool get_reading(uint16_t &reading_cm);
};
#endif //HAL_MSP_ENABLED
#endif //HAL_MSP_RANGEFINDER_ENABLED

Loading…
Cancel
Save