Skip to content
Snippets Groups Projects
Commit 4ba00720 authored by Andrew Tridgell's avatar Andrew Tridgell
Browse files

AP_Compass: make init() private

not called from frontend
parent 1ea4c693
No related branches found
No related tags found
No related merge requests found
...@@ -35,13 +35,13 @@ public: ...@@ -35,13 +35,13 @@ public:
virtual ~AP_Compass_AK8963(); virtual ~AP_Compass_AK8963();
bool init() override;
void read() override; void read() override;
private: private:
AP_Compass_AK8963(Compass &compass, AP_AK8963_BusDriver *bus, AP_Compass_AK8963(Compass &compass, AP_AK8963_BusDriver *bus,
enum Rotation rotation = ROTATION_NONE); enum Rotation rotation = ROTATION_NONE);
bool init();
void _make_factory_sensitivity_adjustment(Vector3f &field) const; void _make_factory_sensitivity_adjustment(Vector3f &field) const;
void _make_adc_sensitivity_adjustment(Vector3f &field) const; void _make_adc_sensitivity_adjustment(Vector3f &field) const;
......
...@@ -30,7 +30,6 @@ public: ...@@ -30,7 +30,6 @@ public:
static AP_Compass_Backend *probe(Compass &compass, static AP_Compass_Backend *probe(Compass &compass,
AP_HAL::OwnPtr<AP_HAL::I2CDevice> dev); AP_HAL::OwnPtr<AP_HAL::I2CDevice> dev);
bool init() override;
void read() override; void read() override;
static constexpr const char *name = "BMM150"; static constexpr const char *name = "BMM150";
...@@ -41,6 +40,7 @@ private: ...@@ -41,6 +40,7 @@ private:
/** /**
* Device periodic callback to read data from the sensor. * Device periodic callback to read data from the sensor.
*/ */
bool init();
bool _update(); bool _update();
bool _load_trim_values(); bool _load_trim_values();
int16_t _compensate_xy(int16_t xy, uint32_t rhall, int32_t txy1, int32_t txy2); int16_t _compensate_xy(int16_t xy, uint32_t rhall, int32_t txy1, int32_t txy2);
......
...@@ -31,9 +31,6 @@ public: ...@@ -31,9 +31,6 @@ public:
// override with a custom destructor if need be. // override with a custom destructor if need be.
virtual ~AP_Compass_Backend(void) {} virtual ~AP_Compass_Backend(void) {}
// initialize the magnetometers
virtual bool init(void) = 0;
// read sensor data // read sensor data
virtual void read(void) = 0; virtual void read(void) = 0;
......
...@@ -28,13 +28,13 @@ public: ...@@ -28,13 +28,13 @@ public:
virtual ~AP_Compass_HMC5843(); virtual ~AP_Compass_HMC5843();
bool init() override;
void read() override; void read() override;
private: private:
AP_Compass_HMC5843(Compass &compass, AP_HMC5843_BusDriver *bus, AP_Compass_HMC5843(Compass &compass, AP_HMC5843_BusDriver *bus,
bool force_external, enum Rotation rotation); bool force_external, enum Rotation rotation);
bool init();
bool _check_whoami(); bool _check_whoami();
bool _calibrate(); bool _calibrate();
bool _setup_sampling_mode(); bool _setup_sampling_mode();
......
...@@ -16,13 +16,13 @@ public: ...@@ -16,13 +16,13 @@ public:
static constexpr const char *name = "LSM9DS1"; static constexpr const char *name = "LSM9DS1";
bool init() override;
void read() override; void read() override;
virtual ~AP_Compass_LSM9DS1() {} virtual ~AP_Compass_LSM9DS1() {}
private: private:
AP_Compass_LSM9DS1(Compass &compass, AP_HAL::OwnPtr<AP_HAL::Device> dev); AP_Compass_LSM9DS1(Compass &compass, AP_HAL::OwnPtr<AP_HAL::Device> dev);
bool init();
bool _check_id(void); bool _check_id(void);
bool _configure(void); bool _configure(void);
bool _set_scale(void); bool _set_scale(void);
......
...@@ -6,7 +6,6 @@ ...@@ -6,7 +6,6 @@
class AP_Compass_QURT : public AP_Compass_Backend class AP_Compass_QURT : public AP_Compass_Backend
{ {
public: public:
bool init(void) override;
void read(void) override; void read(void) override;
AP_Compass_QURT(Compass &compass); AP_Compass_QURT(Compass &compass);
...@@ -15,6 +14,7 @@ public: ...@@ -15,6 +14,7 @@ public:
static AP_Compass_Backend *detect(Compass &compass); static AP_Compass_Backend *detect(Compass &compass);
private: private:
bool init(void);
void timer_update(void); void timer_update(void);
uint8_t instance; uint8_t instance;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment