driver: ll40ls: Correctly instantiate with the right parameters (#8032)

It was setting the rotation value to the I2C slave address
causing it to not be successfully probe.

Changing the constructor paramters order instead of
just fix line instantiating to keep consistency with
the other lidars and sonars.
This commit is contained in:
José Roberto de Souza 2017-09-29 17:25:09 -07:00 committed by Daniel Agar
parent fa458cdf0e
commit 0d5480e540
2 changed files with 4 additions and 3 deletions

View File

@ -49,7 +49,7 @@
#include <stdio.h>
#include <drivers/drv_hrt.h>
LidarLiteI2C::LidarLiteI2C(int bus, const char *path, int address, uint8_t rotation) :
LidarLiteI2C::LidarLiteI2C(int bus, const char *path, uint8_t rotation, int address) :
I2C("LL40LS", path, bus, address, 100000),
_rotation(rotation),
_work{},

View File

@ -71,8 +71,9 @@
class LidarLiteI2C : public LidarLite, public device::I2C
{
public:
LidarLiteI2C(int bus, const char *path, int address = LL40LS_BASEADDR,
uint8_t rotation = distance_sensor_s::ROTATION_DOWNWARD_FACING);
LidarLiteI2C(int bus, const char *path,
uint8_t rotation = distance_sensor_s::ROTATION_DOWNWARD_FACING,
int address = LL40LS_BASEADDR);
virtual ~LidarLiteI2C();
int init() override;