Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
Firmware
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Alberto Ruiz Garcia
Firmware
Commits
7874bbd3
Commit
7874bbd3
authored
12 years ago
by
Lorenz Meier
Browse files
Options
Downloads
Patches
Plain Diff
Updated tests suite properly to MPU-6000 driver, should pass now
parent
a4b27109
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
apps/px4/tests/test_sensors.c
+6
-5
6 additions, 5 deletions
apps/px4/tests/test_sensors.c
with
6 additions
and
5 deletions
apps/px4/tests/test_sensors.c
+
6
−
5
View file @
7874bbd3
...
...
@@ -60,7 +60,7 @@
#include
<arch/board/drv_bma180.h>
#include
<arch/board/drv_l3gd20.h>
#include
<arch/board/drv_hmc5883l.h>
#include
<
arch/board/drv_mpu6000
.h>
#include
<
drivers/drv_accel
.h>
/****************************************************************************
* Pre-processor Definitions
...
...
@@ -331,7 +331,7 @@ mpu6000(int argc, char *argv[])
fflush
(
stdout
);
int
fd
;
int16_t
buf
[
6
]
=
{
-
1
,
0
,
-
1
,
0
,
-
1
,
0
}
;
struct
accel_report
buf
;
int
ret
;
fd
=
open
(
"/dev/accel"
,
O_RDONLY
);
...
...
@@ -345,14 +345,14 @@ mpu6000(int argc, char *argv[])
usleep
(
100000
);
/* read data - expect samples */
ret
=
read
(
fd
,
buf
,
sizeof
(
buf
));
ret
=
read
(
fd
,
&
buf
,
sizeof
(
buf
));
if
(
ret
<
3
)
{
printf
(
"
\t
MPU-6000: read1 fail (%d)
\n
"
,
ret
);
return
ERROR
;
}
else
{
printf
(
"
\t
MPU-6000 values: acc: x:%
d
\t
y:%
d
\t
z:%
d"
);
//\tgyro: r:%d\tp:%d\ty:%d\n", buf[0], buf[1], buf[2], buf[3], buf[4], buf[5]);
printf
(
"
\t
MPU-6000 values: acc: x:%
8.4f
\t
y:%
8.4f
\t
z:%
8.4f
\n
"
,
(
double
)
buf
.
x
,
(
double
)
buf
.
y
,
(
double
)
buf
.
z
);
//\tgyro: r:%d\tp:%d\ty:%d\n", buf[0], buf[1], buf[2], buf[3], buf[4], buf[5]);
}
// /* wait at least 10ms, sensor should have data after no more than 2ms */
...
...
@@ -398,7 +398,8 @@ ms5611(int argc, char *argv[])
ret
=
read
(
fd
,
buf
,
sizeof
(
buf
));
if
(
ret
!=
sizeof
(
buf
))
{
if
((
uint8_t
)
ret
==
-
EAGAIN
||
(
uint8_t
)
ret
==
-
EINPROGRESS
||
i
<
3
)
{
if
((
int8_t
)
ret
==
-
EAGAIN
||
(
int8_t
)
ret
==
-
EINPROGRESS
)
{
/* waiting for device to become ready, this is not an error */
}
else
{
printf
(
"
\t
MS5611: read fail (%d)
\n
"
,
ret
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment