You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by GitBox <gi...@apache.org> on 2020/01/16 15:48:04 UTC

[GitHub] [incubator-nuttx-apps] raiden00pl opened a new pull request #19: add simple HTS221, LSM303 and LSM6DSL examples

raiden00pl opened a new pull request #19: add simple HTS221, LSM303 and LSM6DSL examples
URL: https://github.com/apache/incubator-nuttx-apps/pull/19
 
 
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-nuttx-apps] Ouss4 commented on a change in pull request #19: add simple HTS221, LSM303 and LSM6DSL examples

Posted by GitBox <gi...@apache.org>.
Ouss4 commented on a change in pull request #19: add simple HTS221, LSM303 and LSM6DSL examples
URL: https://github.com/apache/incubator-nuttx-apps/pull/19#discussion_r367593739
 
 

 ##########
 File path: examples/lsm6dsl_reader/lsm6dsl_reader_main.c
 ##########
 @@ -0,0 +1,104 @@
+/****************************************************************************
+ * examples/lsm6dsl_reader/lsm6dsl_reader_main.c
+ *
+ *   Copyright (C) 2020 Gregory Nutt. All rights reserved.
+ *   Author: Mateusz Szafoni <ra...@railab.me>
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ * 3. Neither the name NuttX nor the names of its contributors may be
+ *    used to endorse or promote products derived from this software
+ *    without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+ * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+ * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ ****************************************************************************/
+
+/****************************************************************************
+ * Included Files
+ ****************************************************************************/
+
+#include <nuttx/config.h>
+
+#include <sys/ioctl.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <errno.h>
+#include <unistd.h>
+
+#include <debug.h>
+
+#include <nuttx/sensors/lsm6dsl.h>
+
+/****************************************************************************
+ * Public Functions
+ ****************************************************************************/
+
+/****************************************************************************
+ * lsm6dsl_reader_main
+ ****************************************************************************/
+
+int main(int argc, FAR char *argv[])
+{
+  FILE *sensor;
+  struct lsm6dsl_sensor_data_s sensor_data;
+  int i = 0;
+  int ret;
+
+  sensor = fopen("/dev/lsm6dsl0", "r");
+  if (sensor == NULL)
+    {
+      printf("Unable to create file\n");
+      return -ENOENT;
+    }
+
+  ret = ioctl(fileno(sensor), SNIOC_START, 0);
+  if (ret < 0)
+    {
+      printf("IOCTL SNIOC_START failed %d\n", ret);
+    }
+
+  for (i = 0; 1; i++)
 
 Review comment:
   Will they be changed in the future?
   If not, I'll turn them to `for (;  ; ) `  and merge, if you don't mind.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-nuttx-apps] raiden00pl commented on a change in pull request #19: add simple HTS221, LSM303 and LSM6DSL examples

Posted by GitBox <gi...@apache.org>.
raiden00pl commented on a change in pull request #19: add simple HTS221, LSM303 and LSM6DSL examples
URL: https://github.com/apache/incubator-nuttx-apps/pull/19#discussion_r367597614
 
 

 ##########
 File path: examples/lsm6dsl_reader/lsm6dsl_reader_main.c
 ##########
 @@ -0,0 +1,104 @@
+/****************************************************************************
+ * examples/lsm6dsl_reader/lsm6dsl_reader_main.c
+ *
+ *   Copyright (C) 2020 Gregory Nutt. All rights reserved.
+ *   Author: Mateusz Szafoni <ra...@railab.me>
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ * 3. Neither the name NuttX nor the names of its contributors may be
+ *    used to endorse or promote products derived from this software
+ *    without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+ * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+ * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ ****************************************************************************/
+
+/****************************************************************************
+ * Included Files
+ ****************************************************************************/
+
+#include <nuttx/config.h>
+
+#include <sys/ioctl.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <errno.h>
+#include <unistd.h>
+
+#include <debug.h>
+
+#include <nuttx/sensors/lsm6dsl.h>
+
+/****************************************************************************
+ * Public Functions
+ ****************************************************************************/
+
+/****************************************************************************
+ * lsm6dsl_reader_main
+ ****************************************************************************/
+
+int main(int argc, FAR char *argv[])
+{
+  FILE *sensor;
+  struct lsm6dsl_sensor_data_s sensor_data;
+  int i = 0;
+  int ret;
+
+  sensor = fopen("/dev/lsm6dsl0", "r");
+  if (sensor == NULL)
+    {
+      printf("Unable to create file\n");
+      return -ENOENT;
+    }
+
+  ret = ioctl(fileno(sensor), SNIOC_START, 0);
+  if (ret < 0)
+    {
+      printf("IOCTL SNIOC_START failed %d\n", ret);
+    }
+
+  for (i = 0; 1; i++)
 
 Review comment:
   I don't have any plans for now. You can change them

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-nuttx-apps] raiden00pl commented on a change in pull request #19: add simple HTS221, LSM303 and LSM6DSL examples

Posted by GitBox <gi...@apache.org>.
raiden00pl commented on a change in pull request #19: add simple HTS221, LSM303 and LSM6DSL examples
URL: https://github.com/apache/incubator-nuttx-apps/pull/19#discussion_r367585392
 
 

 ##########
 File path: examples/lsm6dsl_reader/lsm6dsl_reader_main.c
 ##########
 @@ -0,0 +1,104 @@
+/****************************************************************************
+ * examples/lsm6dsl_reader/lsm6dsl_reader_main.c
+ *
+ *   Copyright (C) 2020 Gregory Nutt. All rights reserved.
+ *   Author: Mateusz Szafoni <ra...@railab.me>
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ * 3. Neither the name NuttX nor the names of its contributors may be
+ *    used to endorse or promote products derived from this software
+ *    without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+ * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+ * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ ****************************************************************************/
+
+/****************************************************************************
+ * Included Files
+ ****************************************************************************/
+
+#include <nuttx/config.h>
+
+#include <sys/ioctl.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <errno.h>
+#include <unistd.h>
+
+#include <debug.h>
+
+#include <nuttx/sensors/lsm6dsl.h>
+
+/****************************************************************************
+ * Public Functions
+ ****************************************************************************/
+
+/****************************************************************************
+ * lsm6dsl_reader_main
+ ****************************************************************************/
+
+int main(int argc, FAR char *argv[])
+{
+  FILE *sensor;
+  struct lsm6dsl_sensor_data_s sensor_data;
+  int i = 0;
+  int ret;
+
+  sensor = fopen("/dev/lsm6dsl0", "r");
+  if (sensor == NULL)
+    {
+      printf("Unable to create file\n");
+      return -ENOENT;
+    }
+
+  ret = ioctl(fileno(sensor), SNIOC_START, 0);
+  if (ret < 0)
+    {
+      printf("IOCTL SNIOC_START failed %d\n", ret);
+    }
+
+  for (i = 0; 1; i++)
 
 Review comment:
   Yes, at the moment these are just simple infinite read.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-nuttx-apps] Ouss4 commented on a change in pull request #19: add simple HTS221, LSM303 and LSM6DSL examples

Posted by GitBox <gi...@apache.org>.
Ouss4 commented on a change in pull request #19: add simple HTS221, LSM303 and LSM6DSL examples
URL: https://github.com/apache/incubator-nuttx-apps/pull/19#discussion_r367567443
 
 

 ##########
 File path: examples/lsm6dsl_reader/lsm6dsl_reader_main.c
 ##########
 @@ -0,0 +1,104 @@
+/****************************************************************************
+ * examples/lsm6dsl_reader/lsm6dsl_reader_main.c
+ *
+ *   Copyright (C) 2020 Gregory Nutt. All rights reserved.
+ *   Author: Mateusz Szafoni <ra...@railab.me>
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ * 3. Neither the name NuttX nor the names of its contributors may be
+ *    used to endorse or promote products derived from this software
+ *    without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+ * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+ * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ ****************************************************************************/
+
+/****************************************************************************
+ * Included Files
+ ****************************************************************************/
+
+#include <nuttx/config.h>
+
+#include <sys/ioctl.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <errno.h>
+#include <unistd.h>
+
+#include <debug.h>
+
+#include <nuttx/sensors/lsm6dsl.h>
+
+/****************************************************************************
+ * Public Functions
+ ****************************************************************************/
+
+/****************************************************************************
+ * lsm6dsl_reader_main
+ ****************************************************************************/
+
+int main(int argc, FAR char *argv[])
+{
+  FILE *sensor;
+  struct lsm6dsl_sensor_data_s sensor_data;
+  int i = 0;
+  int ret;
+
+  sensor = fopen("/dev/lsm6dsl0", "r");
+  if (sensor == NULL)
+    {
+      printf("Unable to create file\n");
+      return -ENOENT;
+    }
+
+  ret = ioctl(fileno(sensor), SNIOC_START, 0);
+  if (ret < 0)
+    {
+      printf("IOCTL SNIOC_START failed %d\n", ret);
+    }
+
+  for (i = 0; 1; i++)
 
 Review comment:
   Is an infinite loop exactly what's wanted here?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-nuttx-apps] Ouss4 merged pull request #19: add simple HTS221, LSM303 and LSM6DSL examples

Posted by GitBox <gi...@apache.org>.
Ouss4 merged pull request #19: add simple HTS221, LSM303 and LSM6DSL examples
URL: https://github.com/apache/incubator-nuttx-apps/pull/19
 
 
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services