You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by ag...@apache.org on 2020/06/15 19:11:50 UTC

[incubator-nuttx-apps] branch master updated: bmp180: enable use for BMP280 as well

This is an automated email from the ASF dual-hosted git repository.

aguettouche pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx-apps.git


The following commit(s) were added to refs/heads/master by this push:
     new 49e2c5f  bmp180: enable use for BMP280 as well
49e2c5f is described below

commit 49e2c5fe708a412b05fb78d02e013e5ff30e5120
Author: Matias Nitsche <mn...@dc.uba.ar>
AuthorDate: Mon Jun 15 12:22:53 2020 -0300

    bmp180: enable use for BMP280 as well
---
 examples/bmp180/Kconfig       | 6 +++---
 examples/bmp180/bmp180_main.c | 3 ++-
 2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/examples/bmp180/Kconfig b/examples/bmp180/Kconfig
index f2b63ac..19e778a 100644
--- a/examples/bmp180/Kconfig
+++ b/examples/bmp180/Kconfig
@@ -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
 
diff --git a/examples/bmp180/bmp180_main.c b/examples/bmp180/bmp180_main.c
index 2c58082..84836c1 100644
--- a/examples/bmp180/bmp180_main.c
+++ b/examples/bmp180/bmp180_main.c
@@ -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;
         }