mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-28 22:33:35 +08:00
ms4525_airspeed update test helpers
This commit is contained in:
committed by
Lorenz Meier
parent
641a90708c
commit
15407afc6e
@@ -474,7 +474,7 @@ test()
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* do a simple demand read */
|
/* do a simple demand read */
|
||||||
sz = read(fd, &report, sizeof(report));
|
sz = px4_read(fd, &report, sizeof(report));
|
||||||
|
|
||||||
if (sz != sizeof(report)) {
|
if (sz != sizeof(report)) {
|
||||||
PX4_ERR("immediate read failed");
|
PX4_ERR("immediate read failed");
|
||||||
@@ -490,19 +490,19 @@ test()
|
|||||||
|
|
||||||
/* read the sensor 5x and report each value */
|
/* read the sensor 5x and report each value */
|
||||||
for (unsigned i = 0; i < 5; i++) {
|
for (unsigned i = 0; i < 5; i++) {
|
||||||
struct pollfd fds;
|
px4_pollfd_struct_t fds;
|
||||||
|
|
||||||
/* wait for data to be ready */
|
/* wait for data to be ready */
|
||||||
fds.fd = fd;
|
fds.fd = fd;
|
||||||
fds.events = POLLIN;
|
fds.events = POLLIN;
|
||||||
ret = poll(&fds, 1, 2000);
|
ret = px4_poll(&fds, 1, 2000);
|
||||||
|
|
||||||
if (ret != 1) {
|
if (ret != 1) {
|
||||||
PX4_ERR("timed out");
|
PX4_ERR("timed out");
|
||||||
}
|
}
|
||||||
|
|
||||||
/* now go get it */
|
/* now go get it */
|
||||||
sz = read(fd, &report, sizeof(report));
|
sz = px4_read(fd, &report, sizeof(report));
|
||||||
|
|
||||||
if (sz != sizeof(report)) {
|
if (sz != sizeof(report)) {
|
||||||
PX4_ERR("periodic read failed");
|
PX4_ERR("periodic read failed");
|
||||||
|
|||||||
Reference in New Issue
Block a user