From af54e233489cdb8e652ec2f057241b4c23315fb3 Mon Sep 17 00:00:00 2001 From: Jeonghoon Park Date: Thu, 13 Jun 2019 11:40:54 +0900 Subject: reorder lidar sensor read logic Change-Id: I3034758fc76723d09a19d4d51708be4eba32b671 --- src/resource/resource_lidar_v3.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/resource/resource_lidar_v3.c b/src/resource/resource_lidar_v3.c index 234f8d5..fa6ab19 100644 --- a/src/resource/resource_lidar_v3.c +++ b/src/resource/resource_lidar_v3.c @@ -163,10 +163,10 @@ int resource_read_lidar_v3(unsigned int *out_value) ret = __lidar_v3_i2c_open(I2C_BUS_DEF); retv_if(ret, -1); - ret = __wait_busy_flag(); + ret = peripheral_i2c_write_register_byte(g_sensor_h, LLV3_ACQ_CMD, CMD_WITH_BIAS_CORRECTION); retv_if(ret, -1); - ret = peripheral_i2c_write_register_byte(g_sensor_h, LLV3_ACQ_CMD, CMD_WITH_BIAS_CORRECTION); + ret = __wait_busy_flag(); retv_if(ret, -1); ret = peripheral_i2c_read_register_byte(g_sensor_h, LLv3_DISTANCE_HIGH, &val_h); -- cgit v1.2.3