diff options
author | James Goppert <james.goppert@gmail.com> | 2013-06-15 16:37:15 -0400 |
---|---|---|
committer | James Goppert <james.goppert@gmail.com> | 2013-07-28 00:05:56 -0400 |
commit | 764310620837461857d511144738a521e3840f97 (patch) | |
tree | 9db2376fba8b1d554dfc4c86543a8b0c9a4c43f6 /src/drivers | |
parent | f3bfbd87b1f6faef6bac75c9f94b590bb8b504b6 (diff) | |
download | px4-firmware-764310620837461857d511144738a521e3840f97.tar.gz px4-firmware-764310620837461857d511144738a521e3840f97.tar.bz2 px4-firmware-764310620837461857d511144738a521e3840f97.zip |
Added log print ability to md25 driver.
Diffstat (limited to 'src/drivers')
-rw-r--r-- | src/drivers/md25/md25.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/drivers/md25/md25.cpp b/src/drivers/md25/md25.cpp index f9f5d70ab..4e7e2694a 100644 --- a/src/drivers/md25/md25.cpp +++ b/src/drivers/md25/md25.cpp @@ -49,6 +49,7 @@ #include <systemlib/err.h> #include <arch/board/board.h> +#include <mavlink/mavlink_log.h> // registers enum { @@ -73,6 +74,9 @@ enum { REG_COMMAND_RW, }; +// File descriptors +static int mavlink_fd; + MD25::MD25(const char *deviceName, int bus, uint16_t address, uint32_t speed) : I2C("MD25", deviceName, bus, address, speed), @@ -579,6 +583,7 @@ int md25Sine(const char *deviceName, uint8_t bus, uint8_t address) usleep(1000000 * dt); t += dt; float speed_rpm = 60*(md25.getRevolutions1() - prev_revolution)/dt; + mavlink_log_info(mavlink_fd, "rpm: %10.4f\n", (double)speed_rpm); md25.readData(); if (t > 2.0f) break; } |