bmp180: enable use for BMP280 as well

This commit is contained in:
Matias Nitsche 2020-06-15 12:22:53 -03:00 committed by Abdelatif Guettouche
parent 7aa7454983
commit 49e2c5fe70
2 changed files with 5 additions and 4 deletions
examples/bmp180

@ -4,11 +4,11 @@
#
config EXAMPLES_BMP180
tristate "BMP180 Barometer sensor example"
tristate "BMP180/280 Barometer sensor example"
default n
depends on SENSORS_BMP180
depends on SENSORS_BMP180 || SENSORS_BMP280
---help---
Enable the BMP180 example
Enable the BMP180/BMP280 example
if EXAMPLES_BMP180

@ -56,12 +56,13 @@ int main(int argc, FAR char *argv[])
int ret;
uint32_t sample;
fd = open("/dev/press0", O_RDWR);
fd = open("/dev/press0", O_RDONLY);
while (1)
{
ret = read(fd, &sample, sizeof(uint32_t));
if (ret != sizeof(sample))
{
perror("Could not read");
break;
}