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 2021/06/17 08:22:46 UTC

[incubator-nuttx-apps] branch master updated (920d925 -> 993693d)

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

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


    from 920d925  iperf: Fix an unused function warning seen with clang
     new d838666  sensortest: add '\n' for gps output debug log
     new 993693d  testing/sensor: fix bug about -h

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 testing/sensortest/sensortest.c | 26 +++++++++++++++-----------
 1 file changed, 15 insertions(+), 11 deletions(-)

[incubator-nuttx-apps] 01/02: sensortest: add '\n' for gps output debug log

Posted by ag...@apache.org.
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

commit d838666844a319b6e4d2e799d52bac8717437754
Author: Jiuzhu Dong <do...@xiaomi.com>
AuthorDate: Wed Jan 13 21:43:07 2021 +0800

    sensortest: add '\n' for gps output debug log
    
    MIRTOS-328
    
    Change-Id: Iae2925beae2d63c3ce212875109c3a25cb941a90
    Signed-off-by: Jiuzhu Dong <do...@xiaomi.com>
---
 testing/sensortest/sensortest.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/testing/sensortest/sensortest.c b/testing/sensortest/sensortest.c
index f7dc6e2..cc67629 100644
--- a/testing/sensortest/sensortest.c
+++ b/testing/sensortest/sensortest.c
@@ -1,5 +1,5 @@
 /****************************************************************************
- * apps/testing/sensortest.c
+ * apps/testing/sensortest/sensortest.c
  *
  * Licensed to the Apache Software Foundation (ASF) under one or more
  * contributor license agreements.  See the NOTICE file distributed with
@@ -142,11 +142,11 @@ static void print_gps(const char *buffer, const char *name)
 {
   struct sensor_event_gps *event = (struct sensor_event_gps *)buffer;
 
-  printf("%s: year: %d month: %d day: %d hour: %d min: %d sec: %d msec: %d",
-         name, event->year, event->month, event->day, event->hour,
-         event->min, event->sec, event->msec);
-  printf("%s: yaw: %.4f height: %.4f speed: %.4f latitude: %.4f"
-         "longitude: %.4f", name, event->yaw, event->height, event->speed,
+  printf("%s: year: %d month: %d day: %d hour: %d min: %d sec: %d "
+         "msec: %d\n", name, event->year, event->month, event->day,
+         event->hour, event->min, event->sec, event->msec);
+  printf("%s: yaw: %.4f height: %.4f speed: %.4f latitude: %.4f "
+         "longitude: %.4f\n", name, event->yaw, event->height, event->speed,
          event->latitude, event->longitude);
 }
 

[incubator-nuttx-apps] 02/02: testing/sensor: fix bug about -h

Posted by ag...@apache.org.
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

commit 993693d5f4162961766830b5af53c777ca9482d3
Author: Jiuzhu Dong <do...@xiaomi.com>
AuthorDate: Tue Feb 2 11:55:43 2021 +0800

    testing/sensor: fix bug about -h
    
    MIRTOS-334
    
    Change-Id: I1803ad1c769189f42d223111c7eb898e091eeccc
    Signed-off-by: Jiuzhu Dong <do...@xiaomi.com>
---
 testing/sensortest/sensortest.c | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/testing/sensortest/sensortest.c b/testing/sensortest/sensortest.c
index cc67629..110a4d9 100644
--- a/testing/sensortest/sensortest.c
+++ b/testing/sensortest/sensortest.c
@@ -224,8 +224,7 @@ int main(int argc, FAR char *argv[])
           case 'h':
           default:
             usage();
-            optind = 0;
-            return 0;
+            goto name_err;
         }
     }
 
@@ -247,18 +246,21 @@ int main(int argc, FAR char *argv[])
         {
           printf("The sensor node name:%s is invaild\n", name);
           usage();
-          return -EINVAL;
+          ret = -EINVAL;
+          goto name_err;
         }
 
       if (!buffer)
         {
-          return -ENOMEM;
+          ret = -ENOMEM;
+          goto name_err;
         }
     }
   else
     {
       usage();
-      return -EINVAL;
+      ret = -EINVAL;
+      goto name_err;
     }
 
   snprintf(devname, PATH_MAX, DEVNAME_FMT, name);
@@ -341,5 +343,7 @@ ctl_err:
   close(fd);
 open_err:
   free(buffer);
+name_err:
+  optind = 0;
   return ret;
 }