Fix sensors/hyt271.c:811:16: error: 'data.data' may be used uninitialized [-Werror=maybe-uninitialized]
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
This commit is contained in:
parent
85deafd7bf
commit
e91e144fb6
|
@ -782,11 +782,11 @@ static int hyt271_thread(int argc, char** argv)
|
||||||
{
|
{
|
||||||
FAR struct hyt271_dev_s *priv = (FAR struct hyt271_dev_s *)
|
FAR struct hyt271_dev_s *priv = (FAR struct hyt271_dev_s *)
|
||||||
((uintptr_t)strtoul(argv[1], NULL, 0));
|
((uintptr_t)strtoul(argv[1], NULL, 0));
|
||||||
|
uint32_t orawdata = 0;
|
||||||
|
|
||||||
while (true)
|
while (true)
|
||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
uint32_t orawdata;
|
|
||||||
struct hyt271_sensor_data_s data;
|
struct hyt271_sensor_data_s data;
|
||||||
struct hyt271_sensor_s *hsensor = &priv->sensor[HYT271_SENSOR_HUMI];
|
struct hyt271_sensor_s *hsensor = &priv->sensor[HYT271_SENSOR_HUMI];
|
||||||
struct hyt271_sensor_s *tsensor = &priv->sensor[HYT271_SENSOR_TEMP];
|
struct hyt271_sensor_s *tsensor = &priv->sensor[HYT271_SENSOR_TEMP];
|
||||||
|
@ -806,12 +806,7 @@ static int hyt271_thread(int argc, char** argv)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Store the last sensor data for later comparison */
|
|
||||||
|
|
||||||
orawdata = data.data;
|
|
||||||
|
|
||||||
ret = hyt271_measure_read(priv, &data);
|
ret = hyt271_measure_read(priv, &data);
|
||||||
|
|
||||||
if (!ret)
|
if (!ret)
|
||||||
{
|
{
|
||||||
/* Notify upper */
|
/* Notify upper */
|
||||||
|
@ -838,6 +833,10 @@ static int hyt271_thread(int argc, char** argv)
|
||||||
{
|
{
|
||||||
priv->initial_read = true;
|
priv->initial_read = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Store the last sensor data for later comparison */
|
||||||
|
|
||||||
|
orawdata = data.data;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Sleeping thread before fetching the next sensor data */
|
/* Sleeping thread before fetching the next sensor data */
|
||||||
|
|
Loading…
Reference in New Issue