aboutsummaryrefslogtreecommitdiff
path: root/src/modules/commander/airspeed_calibration.cpp
diff options
context:
space:
mode:
authorAnton Babushkin <anton.babushkin@me.com>2014-05-11 13:36:51 +0200
committerAnton Babushkin <anton.babushkin@me.com>2014-05-11 13:36:51 +0200
commit349809f5353d70eb9d569a267165e0f1b2054e02 (patch)
treecd103bc348a5e57a152945a36e79f73cad7789bb /src/modules/commander/airspeed_calibration.cpp
parent88b18bbad1be31cf31ff964c6cf6f3123948488d (diff)
downloadpx4-firmware-349809f5353d70eb9d569a267165e0f1b2054e02.tar.gz
px4-firmware-349809f5353d70eb9d569a267165e0f1b2054e02.tar.bz2
px4-firmware-349809f5353d70eb9d569a267165e0f1b2054e02.zip
sensors, commander: code style fixed
Diffstat (limited to 'src/modules/commander/airspeed_calibration.cpp')
-rw-r--r--src/modules/commander/airspeed_calibration.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/modules/commander/airspeed_calibration.cpp b/src/modules/commander/airspeed_calibration.cpp
index c8c7a42e7..5d21d89d0 100644
--- a/src/modules/commander/airspeed_calibration.cpp
+++ b/src/modules/commander/airspeed_calibration.cpp
@@ -82,12 +82,15 @@ int do_airspeed_calibration(int mavlink_fd)
bool paramreset_successful = false;
int fd = open(AIRSPEED_DEVICE_PATH, 0);
+
if (fd > 0) {
if (OK == ioctl(fd, AIRSPEEDIOCSSCALE, (long unsigned int)&airscale)) {
paramreset_successful = true;
+
} else {
mavlink_log_critical(mavlink_fd, "airspeed offset zero failed");
}
+
close(fd);
}
@@ -112,8 +115,9 @@ int do_airspeed_calibration(int mavlink_fd)
diff_pres_offset += diff_pres.differential_pressure_raw_pa;
calibration_counter++;
- if (calibration_counter % (calibration_count / 20) == 0)
+ if (calibration_counter % (calibration_count / 20) == 0) {
mavlink_log_info(mavlink_fd, CAL_PROGRESS_MSG, sensor_name, (calibration_counter * 100) / calibration_count);
+ }
} else if (poll_ret == 0) {
/* any poll failure for 1s is a reason to abort */