Printing fixes

This commit is contained in:
Lorenz Meier
2012-08-26 15:01:08 +02:00
parent dfa5cc52d5
commit 56e66a80cd
2 changed files with 14 additions and 14 deletions
+8 -8
View File
@@ -963,13 +963,13 @@ test()
warnx("single read"); warnx("single read");
warnx("time: %lld", a_report.timestamp); warnx("time: %lld", a_report.timestamp);
warnx("acc x: \t% 5.2f\tm/s^2", (double)a_report.x); warnx("acc x: \t% 8.4f\tm/s^2", (double)a_report.x);
warnx("acc y: \t% 5.2f\tm/s^2", (double)a_report.y); warnx("acc y: \t% 8.4f\tm/s^2", (double)a_report.y);
warnx("acc z: \t% 5.2f\tm/s^2", (double)a_report.z); warnx("acc z: \t% 8.4f\tm/s^2", (double)a_report.z);
warnx("acc x: \t%d\traw", a_report.x_raw); warnx("acc x: \t%d\traw", a_report.x_raw);
warnx("acc y: \t%d\traw", a_report.y_raw); warnx("acc y: \t%d\traw", a_report.y_raw);
warnx("acc z: \t%d\traw", a_report.z_raw); warnx("acc z: \t%d\traw", a_report.z_raw);
warnx("acc range: %6.2f m/s^2 (%6.2f g)", (double)a_report.range_m_s2, warnx("acc range: %8.4f m/s^2 (%8.4f g)", (double)a_report.range_m_s2,
(double)(a_report.range_m_s2 / 9.81f)); (double)(a_report.range_m_s2 / 9.81f));
/* do a simple demand read */ /* do a simple demand read */
@@ -977,13 +977,13 @@ test()
if (sz != sizeof(g_report)) if (sz != sizeof(g_report))
err(1, "immediate gyro read failed"); err(1, "immediate gyro read failed");
warnx("gyro x: \t% 5.2f\trad/s", (double)g_report.x); warnx("gyro x: \t% 8.4f\trad/s", (double)g_report.x);
warnx("gyro y: \t% 5.2f\trad/s", (double)g_report.y); warnx("gyro y: \t% 8.4f\trad/s", (double)g_report.y);
warnx("gyro z: \t% 5.2f\trad/s", (double)g_report.z); warnx("gyro z: \t% 8.4f\trad/s", (double)g_report.z);
warnx("gyro x: \t%d\traw", g_report.x_raw); warnx("gyro x: \t%d\traw", g_report.x_raw);
warnx("gyro y: \t%d\traw", g_report.y_raw); warnx("gyro y: \t%d\traw", g_report.y_raw);
warnx("gyro z: \t%d\traw", g_report.z_raw); warnx("gyro z: \t%d\traw", g_report.z_raw);
warnx("gyro range: %6.3f rad/s (%8.2f deg/s)", (double)g_report.range_rad_s, warnx("gyro range: %8.4f rad/s (%8.2f deg/s)", (double)g_report.range_rad_s,
(double)((g_report.range_rad_s / M_PI_F) * 180.0f)); (double)((g_report.range_rad_s / M_PI_F) * 180.0f));
/* XXX add poll-rate tests here too */ /* XXX add poll-rate tests here too */
+6 -6
View File
@@ -834,9 +834,9 @@ test()
err(1, "immediate read failed"); err(1, "immediate read failed");
warnx("single read"); warnx("single read");
warnx("pressure: %10.4f", report.pressure); warnx("pressure: %10.4f", (double)report.pressure);
warnx("altitude: %11.4f", report.altitude); warnx("altitude: %11.4f", (double)report.altitude);
warnx("temperature: %8.4f", report.temperature); warnx("temperature: %8.4f", (double)report.temperature);
warnx("time: %lld", report.timestamp); warnx("time: %lld", report.timestamp);
/* set the queue depth to 10 */ /* set the queue depth to 10 */
@@ -866,9 +866,9 @@ test()
err(1, "periodic read failed"); err(1, "periodic read failed");
warnx("periodic read %u", i); warnx("periodic read %u", i);
warnx("pressure: %u", (unsigned)report.pressure); warnx("pressure: %10.4f", (double)report.pressure);
warnx("altitude: %u", (unsigned)report.altitude); warnx("altitude: %11.4f", (double)report.altitude);
warnx("temperature: %u", (unsigned)report.temperature); warnx("temperature: %8.4f", (double)report.temperature);
warnx("time: %lld", report.timestamp); warnx("time: %lld", report.timestamp);
} }