mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-18 21:03:34 +08:00
drivers start using uORB message print instead of custom
This commit is contained in:
@@ -1413,12 +1413,7 @@ HMC5883::print_info()
|
||||
perf_print_counter(_sample_perf);
|
||||
perf_print_counter(_comms_errors);
|
||||
printf("poll interval: %u ticks\n", _measure_ticks);
|
||||
printf("output (%.2f %.2f %.2f)\n", (double)_last_report.x, (double)_last_report.y, (double)_last_report.z);
|
||||
printf("offsets (%.2f %.2f %.2f)\n", (double)_scale.x_offset, (double)_scale.y_offset, (double)_scale.z_offset);
|
||||
printf("scaling (%.2f %.2f %.2f) 1/range_scale %.2f range_ga %.2f\n",
|
||||
(double)_scale.x_scale, (double)_scale.y_scale, (double)_scale.z_scale,
|
||||
(double)(1.0f / _range_scale), (double)_range_ga);
|
||||
printf("temperature %.2f\n", (double)_last_report.temperature);
|
||||
print_message(_last_report);
|
||||
_reports->print_info("report queue");
|
||||
}
|
||||
|
||||
@@ -1598,9 +1593,7 @@ test(enum HMC5883_BUS busid)
|
||||
err(1, "immediate read failed");
|
||||
}
|
||||
|
||||
warnx("single read");
|
||||
warnx("measurement: %.6f %.6f %.6f", (double)report.x, (double)report.y, (double)report.z);
|
||||
warnx("time: %lld", report.timestamp);
|
||||
print_message(report);
|
||||
|
||||
/* check if mag is onboard or external */
|
||||
if ((ret = ioctl(fd, MAGIOCGEXTERNAL, 0)) < 0) {
|
||||
@@ -1639,9 +1632,7 @@ test(enum HMC5883_BUS busid)
|
||||
err(1, "periodic read failed");
|
||||
}
|
||||
|
||||
warnx("periodic read %u", i);
|
||||
warnx("measurement: %.6f %.6f %.6f", (double)report.x, (double)report.y, (double)report.z);
|
||||
warnx("time: %lld", report.timestamp);
|
||||
print_message(report);
|
||||
}
|
||||
|
||||
errx(0, "PASS");
|
||||
|
||||
@@ -1253,12 +1253,7 @@ IST8310::print_info()
|
||||
perf_print_counter(_sample_perf);
|
||||
perf_print_counter(_comms_errors);
|
||||
printf("poll interval: %u ticks\n", _measure_ticks);
|
||||
printf("output (%.2f %.2f %.2f)\n", (double)_last_report.x, (double)_last_report.y, (double)_last_report.z);
|
||||
printf("offsets (%.2f %.2f %.2f)\n", (double)_scale.x_offset, (double)_scale.y_offset, (double)_scale.z_offset);
|
||||
printf("scaling (%.2f %.2f %.2f) 1/range_scale %.2f\n",
|
||||
(double)_scale.x_scale, (double)_scale.y_scale, (double)_scale.z_scale,
|
||||
(double)(1.0f / _range_scale));
|
||||
printf("temperature %.2f\n", (double)_last_report.temperature);
|
||||
print_message(_last_report);
|
||||
_reports->print_info("report queue");
|
||||
}
|
||||
|
||||
@@ -1412,17 +1407,13 @@ test(enum IST8310_BUS busid)
|
||||
err(1, "immediate read failed");
|
||||
}
|
||||
|
||||
PX4_INFO("single read");
|
||||
PX4_INFO("measurement: %.6f %.6f %.6f", (double)report.x, (double)report.y, (double)report.z);
|
||||
PX4_INFO("time: %lld", report.timestamp);
|
||||
print_message(report);
|
||||
|
||||
/* check if mag is onboard or external */
|
||||
if ((ret = ioctl(fd, MAGIOCGEXTERNAL, 0)) < 0) {
|
||||
errx(1, "failed to get if mag is onboard or external");
|
||||
}
|
||||
|
||||
PX4_INFO("device active: %s", ret ? "external" : "onboard");
|
||||
|
||||
/* set the queue depth to 5 */
|
||||
if (OK != ioctl(fd, SENSORIOCSQUEUEDEPTH, 10)) {
|
||||
errx(1, "failed to set queue depth");
|
||||
@@ -1453,9 +1444,7 @@ test(enum IST8310_BUS busid)
|
||||
err(1, "periodic read failed");
|
||||
}
|
||||
|
||||
PX4_INFO("periodic read %u", i);
|
||||
PX4_INFO("measurement: %.6f %.6f %.6f", (double)report.x, (double)report.y, (double)report.z);
|
||||
PX4_INFO("time: %lld", report.timestamp);
|
||||
print_message(report);
|
||||
}
|
||||
|
||||
PX4_INFO("PASS");
|
||||
|
||||
@@ -1297,12 +1297,7 @@ LIS3MDL::print_info()
|
||||
perf_print_counter(_sample_perf);
|
||||
perf_print_counter(_comms_errors);
|
||||
printf("poll interval: %u ticks\n", _measure_ticks);
|
||||
printf("output (%.2f %.2f %.2f)\n", (double)_last_report.x, (double)_last_report.y, (double)_last_report.z);
|
||||
printf("offsets (%.2f %.2f %.2f)\n", (double)_scale.x_offset, (double)_scale.y_offset, (double)_scale.z_offset);
|
||||
printf("scaling (%.2f %.2f %.2f) 1/range_scale %.2f range_ga %.2f\n",
|
||||
(double)_scale.x_scale, (double)_scale.y_scale, (double)_scale.z_scale,
|
||||
(double)(1.0f / _range_scale), (double)_range_ga);
|
||||
printf("temperature %.2f\n", (double)_last_report.temperature);
|
||||
print_message(_last_report);
|
||||
_reports->print_info("report queue");
|
||||
}
|
||||
|
||||
@@ -1494,17 +1489,13 @@ test(enum LIS3MDL_BUS busid)
|
||||
err(1, "immediate read failed");
|
||||
}
|
||||
|
||||
warnx("single read");
|
||||
warnx("measurement: %.6f %.6f %.6f", (double)report.x, (double)report.y, (double)report.z);
|
||||
warnx("time: %lld", report.timestamp);
|
||||
print_message(report);
|
||||
|
||||
/* check if mag is onboard or external */
|
||||
if ((ret = ioctl(fd, MAGIOCGEXTERNAL, 0)) < 0) {
|
||||
errx(1, "failed to get if mag is onboard or external");
|
||||
}
|
||||
|
||||
warnx("device active: %s", ret ? "external" : "onboard");
|
||||
|
||||
/* set the queue depth to 5 */
|
||||
if (OK != ioctl(fd, SENSORIOCSQUEUEDEPTH, 10)) {
|
||||
errx(1, "failed to set queue depth");
|
||||
@@ -1535,9 +1526,7 @@ test(enum LIS3MDL_BUS busid)
|
||||
err(1, "periodic read failed");
|
||||
}
|
||||
|
||||
warnx("periodic read %u", i);
|
||||
warnx("measurement: %.6f %.6f %.6f", (double)report.x, (double)report.y, (double)report.z);
|
||||
warnx("time: %lld", report.timestamp);
|
||||
print_message(report);
|
||||
}
|
||||
|
||||
errx(0, "PASS");
|
||||
|
||||
Reference in New Issue
Block a user