AP_Airspeed: reuse airspeed backend contructor in more backends

... and clean out some unused includes
This commit is contained in:
Peter Barker 2022-08-01 11:02:23 +10:00 committed by Peter Barker
parent 4f355f7c8b
commit 89a1330801
9 changed files with 6 additions and 25 deletions

View File

@ -13,11 +13,6 @@ extern const AP_HAL::HAL& hal;
AP_Airspeed_DroneCAN::DetectedModules AP_Airspeed_DroneCAN::_detected_modules[];
HAL_Semaphore AP_Airspeed_DroneCAN::_sem_registry;
// constructor
AP_Airspeed_DroneCAN::AP_Airspeed_DroneCAN(AP_Airspeed &_frontend, uint8_t _instance) :
AP_Airspeed_Backend(_frontend, _instance)
{}
void AP_Airspeed_DroneCAN::subscribe_msgs(AP_DroneCAN* ap_dronecan)
{
if (ap_dronecan == nullptr) {

View File

@ -14,7 +14,8 @@
class AP_Airspeed_DroneCAN : public AP_Airspeed_Backend {
public:
AP_Airspeed_DroneCAN(AP_Airspeed &_frontend, uint8_t _instance);
using AP_Airspeed_Backend::AP_Airspeed_Backend;
bool init(void) override;

View File

@ -27,7 +27,6 @@
*/
#include <AP_HAL/AP_HAL.h>
#include <AP_Param/AP_Param.h>
#include <AP_HAL/utility/OwnPtr.h>
#include <AP_HAL/I2CDevice.h>
#include <utility>

View File

@ -27,7 +27,6 @@
#if AP_AIRSPEED_MS5525_ENABLED
#include <AP_HAL/AP_HAL.h>
#include <AP_Param/AP_Param.h>
#include <AP_HAL/utility/OwnPtr.h>
#include <AP_HAL/I2CDevice.h>
#include <utility>

View File

@ -30,13 +30,6 @@
#define TIMEOUT_MS 2000
extern const AP_HAL::HAL &hal;
AP_Airspeed_NMEA::AP_Airspeed_NMEA(AP_Airspeed &_frontend, uint8_t _instance) :
AP_Airspeed_Backend(_frontend, _instance)
{
}
bool AP_Airspeed_NMEA::init()
{
const AP_SerialManager& serial_manager = AP::serialmanager();

View File

@ -15,7 +15,8 @@
class AP_Airspeed_NMEA : public AP_Airspeed_Backend
{
public:
AP_Airspeed_NMEA(AP_Airspeed &frontend, uint8_t _instance);
using AP_Airspeed_Backend::AP_Airspeed_Backend;
// probe and initialise the sensor
bool init(void) override;

View File

@ -42,11 +42,6 @@
extern const AP_HAL::HAL &hal;
AP_Airspeed_SDP3X::AP_Airspeed_SDP3X(AP_Airspeed &_frontend, uint8_t _instance) :
AP_Airspeed_Backend(_frontend, _instance)
{
}
/*
send a 16 bit command code
*/

View File

@ -27,7 +27,6 @@
*/
#include <AP_HAL/AP_HAL.h>
#include <AP_Param/AP_Param.h>
#include <AP_HAL/utility/OwnPtr.h>
#include <AP_HAL/I2CDevice.h>
#include <utility>
@ -42,8 +41,8 @@
class AP_Airspeed_SDP3X : public AP_Airspeed_Backend
{
public:
AP_Airspeed_SDP3X(AP_Airspeed &frontend, uint8_t _instance);
~AP_Airspeed_SDP3X(void) {}
using AP_Airspeed_Backend::AP_Airspeed_Backend;
// probe and initialise the sensor
bool init() override;

View File

@ -9,7 +9,6 @@
#if AP_AIRSPEED_ANALOG_ENABLED
#include <AP_HAL/AP_HAL.h>
#include <AP_Param/AP_Param.h>
#include "AP_Airspeed_Backend.h"