@ -87,10 +55,10 @@ int LidarLite::ioctl(device::file_t *filp, int cmd, unsigned long arg)
@@ -87,10 +55,10 @@ int LidarLite::ioctl(device::file_t *filp, int cmd, unsigned long arg)
/* set default polling rate */
caseSENSOR_POLLRATE_DEFAULT:{
/* do we need to start internal polling? */
boolwant_start=(_measure_ticks==0);
boolwant_start=(_measure_interval==0);
/* set interval for next measurement to minimum legal value */
/* if we need to start the poll state machine, do it */
if(want_start){
@ -103,18 +71,18 @@ int LidarLite::ioctl(device::file_t *filp, int cmd, unsigned long arg)
@@ -103,18 +71,18 @@ int LidarLite::ioctl(device::file_t *filp, int cmd, unsigned long arg)
/* adjust to a legal polling interval in Hz */
default:{
/* do we need to start internal polling? */
boolwant_start=(_measure_ticks==0);
boolwant_start=(_measure_interval==0);
/* convert hz to tick interval via microseconds */
unsignedticks=USEC2TICK(1000000/arg);
unsignedinterval=(1000000/arg);
/* check against maximum rate */
if(ticks<USEC2TICK(LL40LS_CONVERSION_INTERVAL)){
if(interval<(LL40LS_CONVERSION_INTERVAL)){
return-EINVAL;
}
/* update interval for next measurement */
_measure_ticks=ticks;
_measure_interval=interval;
/* if we need to start the poll state machine, do it */