LidarLite: Code cleanup

This commit is contained in:
Johan Jansen
2015-03-24 11:49:34 +01:00
parent b1da12b43f
commit 874c319888
4 changed files with 29 additions and 6 deletions
+4 -3
View File
@@ -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;
+3 -3
View File
@@ -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.
+15
View File
@@ -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;
}
+7
View File
@@ -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;