mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-18 19:23:34 +08:00
LidarLite: Code cleanup
This commit is contained in:
@@ -80,9 +80,6 @@ public:
|
||||
*/
|
||||
virtual void print_registers() = 0;
|
||||
|
||||
private:
|
||||
virtual int reset_sensor() = 0;
|
||||
|
||||
protected:
|
||||
/**
|
||||
* Set the min and max distance thresholds if you want the end points of the sensors
|
||||
@@ -96,6 +93,10 @@ protected:
|
||||
|
||||
uint32_t getMeasureTicks() const;
|
||||
|
||||
virtual int measure() = 0;
|
||||
|
||||
virtual int reset_sensor() = 0;
|
||||
|
||||
private:
|
||||
float _min_distance;
|
||||
float _max_distance;
|
||||
|
||||
@@ -95,6 +95,9 @@ protected:
|
||||
virtual int probe();
|
||||
virtual int read_reg(uint8_t reg, uint8_t &val);
|
||||
|
||||
int measure() override;
|
||||
int reset_sensor() override;
|
||||
|
||||
private:
|
||||
work_s _work;
|
||||
RingBuffer *_reports;
|
||||
@@ -144,11 +147,8 @@ private:
|
||||
* and start a new one.
|
||||
*/
|
||||
void cycle();
|
||||
int measure();
|
||||
int collect();
|
||||
|
||||
int reset_sensor() override;
|
||||
|
||||
/**
|
||||
* Static trampoline from the workq context; because we don't have a
|
||||
* generic workq wrapper yet.
|
||||
|
||||
@@ -73,3 +73,18 @@ void LidarLitePWM::print_registers()
|
||||
{
|
||||
printf("Not supported in PWM mode\n");
|
||||
}
|
||||
|
||||
void LidarLitePWM::start()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void LidarLitePWM::stop()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
int LidarLitePWM::measure()
|
||||
{
|
||||
return OK;
|
||||
}
|
||||
@@ -51,6 +51,10 @@ public:
|
||||
|
||||
int init() override;
|
||||
|
||||
void start() override;
|
||||
|
||||
void stop() override;
|
||||
|
||||
/**
|
||||
* @brief
|
||||
* Diagnostics - print some basic information about the driver.
|
||||
@@ -63,6 +67,9 @@ public:
|
||||
*/
|
||||
void print_registers() override;
|
||||
|
||||
protected:
|
||||
int measure() override;
|
||||
|
||||
private:
|
||||
int _pwmSub;
|
||||
pwm_input_s _pwm;
|
||||
|
||||
Reference in New Issue
Block a user