diff options
author | Greg Hulands <ghulands@me.com> | 2013-03-01 10:03:40 -0800 |
---|---|---|
committer | Greg Hulands <ghulands@me.com> | 2013-03-01 10:03:40 -0800 |
commit | 349af372d0823d3e7f8cbc0c247d2af81e7c44a9 (patch) | |
tree | fcde4eb257eb0bcaa5167ae9f137e9353bc4a6f5 /apps/drivers/mb12xx/mb12xx.cpp | |
parent | 6eca4ba462440c8b3d45a2e44ac1f2085554d638 (diff) | |
download | px4-firmware-349af372d0823d3e7f8cbc0c247d2af81e7c44a9.tar.gz px4-firmware-349af372d0823d3e7f8cbc0c247d2af81e7c44a9.tar.bz2 px4-firmware-349af372d0823d3e7f8cbc0c247d2af81e7c44a9.zip |
Changes from pull request feedback
Diffstat (limited to 'apps/drivers/mb12xx/mb12xx.cpp')
-rw-r--r-- | apps/drivers/mb12xx/mb12xx.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/apps/drivers/mb12xx/mb12xx.cpp b/apps/drivers/mb12xx/mb12xx.cpp index d7a3357c8..0e4712f5a 100644 --- a/apps/drivers/mb12xx/mb12xx.cpp +++ b/apps/drivers/mb12xx/mb12xx.cpp @@ -157,7 +157,7 @@ private: /** * Set the min and max distance thresholds if you want the end points of the sensors - * range to be bought in at all, otherwise it will use the defaults MB12XX_MIN_DISTANCE + * range to be brought in at all, otherwise it will use the defaults MB12XX_MIN_DISTANCE * and MB12XX_MAX_DISTANCE */ void set_minimum_distance(float min); @@ -388,13 +388,13 @@ MB12XX::ioctl(struct file *filp, int cmd, unsigned long arg) case RANGEFINDERIOCSETMINIUMDISTANCE: { - set_minimum_distance((float)arg); + set_minimum_distance(*(float *)arg); return 0; } break; case RANGEFINDERIOCSETMAXIUMDISTANCE: { - set_maximum_distance((float)arg); + set_maximum_distance(*(float *)arg); return 0; } break; @@ -471,8 +471,8 @@ MB12XX::measure() /* * Send the command to begin a measurement. */ - uint8_t cmd[] = {MB12XX_TAKE_RANGE_REG}; - ret = I2C::write(&cmd[0], 1); + uint8_t cmd = MB12XX_TAKE_RANGE_REG; + ret = transfer(&cmd, 1, nullptr, 0); if (OK != ret) { @@ -495,7 +495,7 @@ MB12XX::collect() perf_begin(_sample_perf); - ret = I2C::read(&val[0], 2); + ret = transfer(nullptr, 0, &val[0], 2); if (ret < 0) { |