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/11/28 11:19:46 UTC

[incubator-nuttx-apps] branch master updated (b506600 -> d64929d)

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 b506600  irtest: use global arrays instead of __attributes__((section)) organization
     new 12a5a5c  examples: Ignore the default action if app call sigwait
     new d64929d  Fix nxstyle warning

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:
 examples/buttons/buttons_main.c     |  4 ++++
 examples/chrono/chrono_main.c       |  4 ++++
 examples/djoystick/djoy_main.c      |  8 +++++++-
 examples/oneshot/oneshot_main.c     | 15 ++++++++++-----
 examples/zerocross/zerocross_main.c |  5 +++++
 5 files changed, 30 insertions(+), 6 deletions(-)


[incubator-nuttx-apps] 02/02: Fix nxstyle warning

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 d64929d736ba071d3ffd74bc8c7bdde9fd129f4e
Author: Xiang Xiao <xi...@xiaomi.com>
AuthorDate: Wed Nov 18 13:26:11 2020 +0800

    Fix nxstyle warning
    
    Signed-off-by: Xiang Xiao <xi...@xiaomi.com>
---
 examples/djoystick/djoy_main.c      |  4 +++-
 examples/oneshot/oneshot_main.c     | 11 ++++++-----
 examples/zerocross/zerocross_main.c |  1 +
 3 files changed, 10 insertions(+), 6 deletions(-)

diff --git a/examples/djoystick/djoy_main.c b/examples/djoystick/djoy_main.c
index 5649dc1..41b494d 100644
--- a/examples/djoystick/djoy_main.c
+++ b/examples/djoystick/djoy_main.c
@@ -51,6 +51,7 @@
 /****************************************************************************
  * Pre-processor Definitions
  ****************************************************************************/
+
 /* Configuration ************************************************************/
 
 #ifndef CONFIG_DJOYSTICK
@@ -83,6 +84,7 @@ static void show_joystick(djoy_buttonset_t oldset, djoy_buttonset_t newset);
 /****************************************************************************
  * Private Data
  ****************************************************************************/
+
 /* The set of supported joystick discretes */
 
 static djoy_buttonset_t g_djoysupported;
@@ -196,7 +198,7 @@ int main(int argc, FAR char *argv[])
 
   /* Then loop, receiving signals indicating joystick events. */
 
-  for (;;)
+  for (; ; )
     {
       struct siginfo value;
       sigset_t set;
diff --git a/examples/oneshot/oneshot_main.c b/examples/oneshot/oneshot_main.c
index d5803fc..68b213a 100644
--- a/examples/oneshot/oneshot_main.c
+++ b/examples/oneshot/oneshot_main.c
@@ -90,10 +90,10 @@ static void show_usage(FAR const char *progname)
   fprintf(stderr, "USAGE: %s [-d <usecs>] [<devname>]\n", progname);
   fprintf(stderr, "Where:\n");
   fprintf(stderr, "\t-d <usecs>:\n");
-  fprintf(stderr, "\tSpecifies the oneshot delay in microseconds.  Default %ld\n",
-          (unsigned long)CONFIG_EXAMPLES_ONESHOT_DELAY);
+  fprintf(stderr, "\tSpecifies the oneshot delay in microseconds."
+          " Default %ld\n", (unsigned long)CONFIG_EXAMPLES_ONESHOT_DELAY);
   fprintf(stderr, "\t<devname>:\n");
-  fprintf(stderr, "\tSpecifies the path to the oneshot driver.  Default %s\n",
+  fprintf(stderr, "\tSpecifies the path to the oneshot driver. Default %s\n",
           CONFIG_EXAMPLES_ONESHOT_DEVNAME);
   exit(EXIT_FAILURE);
 }
@@ -149,7 +149,8 @@ int main(int argc, FAR char *argv[])
         }
       else
         {
-          fprintf(stderr, "ERROR: Unsupported number of arguments: %d\n", argc);
+          fprintf(stderr, "ERROR: Unsupported number of arguments: %d\n",
+                  argc);
           show_usage(argv[0]);
         }
     }
@@ -244,7 +245,7 @@ int main(int argc, FAR char *argv[])
       ret = ioctl(fd, OSIOC_START, (unsigned long)((uintptr_t)&start));
       if (ret < 0)
         {
-          fprintf(stderr, "ERROR: Failed to start the oneshot interval: %d\n",
+          fprintf(stderr, "ERROR: Failed to start the oneshot: %d\n",
                  errno);
           close(fd);
           return EXIT_FAILURE;
diff --git a/examples/zerocross/zerocross_main.c b/examples/zerocross/zerocross_main.c
index afe78cb..ca71631 100644
--- a/examples/zerocross/zerocross_main.c
+++ b/examples/zerocross/zerocross_main.c
@@ -51,6 +51,7 @@
 /****************************************************************************
  * Pre-processor Definitions
  ****************************************************************************/
+
 /* Configuration ************************************************************/
 
 #ifndef CONFIG_SENSORS_ZEROCROSS


[incubator-nuttx-apps] 01/02: examples: Ignore the default action if app call sigwait

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 12a5a5cce98da2c4b1acb0f413ba9e47a7bdd0b9
Author: Xiang Xiao <xi...@xiaomi.com>
AuthorDate: Wed Nov 18 12:28:11 2020 +0800

    examples: Ignore the default action if app call sigwait
    
    Because the configured signo may have the default action(e.g. SIGPIPE),
    and then will generate the bad side effect before the caller wakeup.
    
    Signed-off-by: Xiang Xiao <xi...@xiaomi.com>
---
 examples/buttons/buttons_main.c     | 4 ++++
 examples/chrono/chrono_main.c       | 4 ++++
 examples/djoystick/djoy_main.c      | 4 ++++
 examples/oneshot/oneshot_main.c     | 4 ++++
 examples/zerocross/zerocross_main.c | 4 ++++
 5 files changed, 20 insertions(+)

diff --git a/examples/buttons/buttons_main.c b/examples/buttons/buttons_main.c
index e019e55..ae4837c 100644
--- a/examples/buttons/buttons_main.c
+++ b/examples/buttons/buttons_main.c
@@ -230,6 +230,10 @@ static int button_daemon(int argc, char *argv[])
              errcode);
       goto errout_with_fd;
     }
+
+  /* Ignore the default signal action */
+
+  signal(CONFIG_EXAMPLES_BUTTONS_SIGNO, SIG_IGN);
 #endif
 
   /* Now loop forever, waiting BUTTONs events */
diff --git a/examples/chrono/chrono_main.c b/examples/chrono/chrono_main.c
index f7b17b6..b385280 100644
--- a/examples/chrono/chrono_main.c
+++ b/examples/chrono/chrono_main.c
@@ -177,6 +177,10 @@ static int chrono_daemon(int argc, char *argv[])
       goto errout_with_fd;
     }
 
+  /* Ignore the default signal action */
+
+  signal(BUTTON_SIGNO, SIG_IGN);
+
   /* Now loop forever, waiting BUTTONs events */
 
   for (; ; )
diff --git a/examples/djoystick/djoy_main.c b/examples/djoystick/djoy_main.c
index cddd344..5649dc1 100644
--- a/examples/djoystick/djoy_main.c
+++ b/examples/djoystick/djoy_main.c
@@ -190,6 +190,10 @@ int main(int argc, FAR char *argv[])
       goto errout_with_fd;
     }
 
+  /* Ignore the default signal action */
+
+  signal(CONFIG_EXAMPLES_DJOYSTICK_SIGNO, SIG_IGN);
+
   /* Then loop, receiving signals indicating joystick events. */
 
   for (;;)
diff --git a/examples/oneshot/oneshot_main.c b/examples/oneshot/oneshot_main.c
index 02d7d94..d5803fc 100644
--- a/examples/oneshot/oneshot_main.c
+++ b/examples/oneshot/oneshot_main.c
@@ -181,6 +181,10 @@ int main(int argc, FAR char *argv[])
 
   printf("Maximum delay is %llu\n", maxus);
 
+  /* Ignore the default signal action */
+
+  signal(CONFIG_EXAMPLES_ONESHOT_SIGNO, SIG_IGN);
+
   /* Loop waiting until the full delay expires */
 
   while (usecs > 0)
diff --git a/examples/zerocross/zerocross_main.c b/examples/zerocross/zerocross_main.c
index 5f45e5f..afe78cb 100644
--- a/examples/zerocross/zerocross_main.c
+++ b/examples/zerocross/zerocross_main.c
@@ -112,6 +112,10 @@ int main(int argc, FAR char *argv[])
       goto errout_with_fd;
     }
 
+  /* Ignore the default signal action */
+
+  signal(CONFIG_EXAMPLES_ZEROCROSS_SIGNO, SIG_IGN);
+
   /* Then loop, receiving signals indicating zero cross events. */
 
   for (; ; )