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
97f732cc
Commit
97f732cc
authored
11 years ago
by
Lorenz Meier
Browse files
Options
Downloads
Patches
Plain Diff
Fixed up ets driver (not tested, WIP on meas driver)
parent
08ddbbc2
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/drivers/ets_airspeed/ets_airspeed.cpp
+1
-1
1 addition, 1 deletion
src/drivers/ets_airspeed/ets_airspeed.cpp
src/drivers/meas_airspeed/meas_airspeed.cpp
+21
-21
21 additions, 21 deletions
src/drivers/meas_airspeed/meas_airspeed.cpp
with
22 additions
and
22 deletions
src/drivers/ets_airspeed/ets_airspeed.cpp
+
1
−
1
View file @
97f732cc
...
...
@@ -282,7 +282,7 @@ start(int i2c_bus)
if
(
g_dev
==
nullptr
)
goto
fail
;
if
(
OK
!=
g_dev
->
init
())
if
(
OK
!=
g_dev
->
Airspeed
::
init
())
goto
fail
;
/* set the poll rate to default, starts automatic data collection */
...
...
This diff is collapsed.
Click to expand it.
src/drivers/meas_airspeed/meas_airspeed.cpp
+
21
−
21
View file @
97f732cc
...
...
@@ -278,7 +278,7 @@ namespace meas_airspeed
#endif
const
int
ERROR
=
-
1
;
MEASAirspeed
*
g_dev
;
MEASAirspeed
*
g_dev
=
nullptr
;
void
start
(
int
i2c_bus
);
void
stop
();
...
...
@@ -300,47 +300,47 @@ start(int i2c_bus)
/* create the driver, try the MS4525DO first */
//g_dev = new MEASAirspeed(i2c_bus, I2C_ADDRESS_MS4525DO);
{
int
bus
=
PX4_I2C_BUS_EXPANSION
;
//delete g_dev;
// XXX hack scan all addresses
for
(
int
i
=
1
;
i
<
0xF
F
/
2
;
i
++
)
{
warnx
(
"scanning addr (7 bit): %0x"
,
i
);
for
(
int
i
=
0x20
/
2
;
i
<
0xF
E
/
2
;
i
++
)
{
warnx
(
"scanning addr (7 bit):
0x
%0
2
x"
,
i
);
g_dev
=
new
MEASAirspeed
(
bus
,
i
);
warnx
(
"probing"
);
if
(
OK
==
g_dev
->
init
())
{
if
(
OK
==
g_dev
->
Airspeed
::
init
())
{
warnx
(
"SUCCESS!"
);
usleep
(
200000
);
exit
(
0
);
}
else
{
warnx
(
"FAIL!"
);
usleep
(
200000
);
delete
g_dev
;
}
}
//
bus = PX4_I2C_BUS_ESC;
bus
=
PX4_I2C_BUS_ESC
;
// for (int i = 1; i < 0xFF / 2; i++) {
// warnx("scanning addr (7 bit): %0x", i);
// g_dev = new MEASAirspeed(bus, i);
// if (OK == g_dev->init()) {
// warnx("SUCCESS!");
// exit(0);
// } else {
// delete g_dev;
// }
// }
for
(
int
i
=
1
;
i
<
0xFF
/
2
;
i
++
)
{
warnx
(
"scanning addr (7 bit): %0x"
,
i
);
g_dev
=
new
MEASAirspeed
(
bus
,
i
);
if
(
OK
==
g_dev
->
Airspeed
::
init
())
{
warnx
(
"SUCCESS!"
);
exit
(
0
);
}
else
{
delete
g_dev
;
}
exit
(
1
);
}
}
/* check if the MS4525DO was instantiated */
if
(
g_dev
==
nullptr
)
goto
fail
;
/* try the MS5525DSO next if init fails */
if
(
OK
!=
g_dev
->
init
())
if
(
OK
!=
g_dev
->
Airspeed
::
init
())
delete
g_dev
;
g_dev
=
new
MEASAirspeed
(
i2c_bus
,
I2C_ADDRESS_MS5525DSO
);
...
...
@@ -349,7 +349,7 @@ start(int i2c_bus)
goto
fail
;
/* both versions failed if the init for the MS5525DSO fails, give up */
if
(
OK
!=
g_dev
->
init
())
if
(
OK
!=
g_dev
->
Airspeed
::
init
())
goto
fail
;
/* set the poll rate to default, starts automatic data collection */
...
...
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