Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Valentin Platzgummer
qgroundcontrol
Commits
06c36b8b
Commit
06c36b8b
authored
Jan 07, 2014
by
Don Gagne
Browse files
ind_airspeed used uninitialized when _sensorHilEnabled == false
Fixing -Wuninitialized
parent
e547004f
Changes
1
Show whitespace changes
Inline
Side-by-side
src/comm/QGCFlightGearLink.cc
View file @
06c36b8b
...
...
@@ -281,12 +281,6 @@ void QGCFlightGearLink::readBytes()
temperature
=
values
.
at
(
19
).
toFloat
();
abs_pressure
=
values
.
at
(
20
).
toFloat
()
*
1e2
;
//convert to Pa from hPa
// Send updated state
//qDebug() << "sensorHilEnabled: " << sensorHilEnabled;
if
(
_sensorHilEnabled
)
{
quint16
fields_changed
=
0xFFF
;
//set all 12 used bits
//calculate differential pressure
const
float
air_gas_constant
=
287.1
f
;
// J/(kg * K)
const
float
absolute_null_celsius
=
-
273.15
f
;
// °C
...
...
@@ -306,6 +300,12 @@ void QGCFlightGearLink::readBytes()
//qDebug() << "ind_airspeed: " << ind_airspeed << "true_airspeed: " << true_airspeed;
// Send updated state
//qDebug() << "sensorHilEnabled: " << sensorHilEnabled;
if
(
_sensorHilEnabled
)
{
quint16
fields_changed
=
0xFFF
;
//set all 12 used bits
float
pressure_alt
=
alt
;
xmag_ned
=
cosf
(
mag_variation
);
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment