hdc1008_demo: set intial measurement mode

No mode was set before the first read by the app.
The first time the app was run, it worked properly, reading
temperature and humidity on the first read(). But subsequent reads
returned humidity only since that was last mode set up.
Also, the ioctl read was returning invalid results.
This commit is contained in:
Diego Herranz 2021-05-16 12:32:54 +01:00 committed by Alan Carvalho de Assis
parent ccc8ddaf5d
commit d74ac654a9

View File

@ -69,6 +69,14 @@ int main(int argc, FAR char *argv[])
/* Read both t and rh */
ret = ioctl(fd, SNIOC_SET_OPERATIONAL_MODE, HDC1008_MEAS_T_AND_RH);
if (ret < 0)
{
printf("Failed to set temperature and humidity measurement mode: %d\n",
errno);
goto out;
}
ret = read(fd, buf, sizeof(buf));
if (ret < 0)
{