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

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

commit 6daab509ca5575a697e864c2fe71b63f2dd8da13
Author: Beat Küng <beat-ku...@gmx.net>
AuthorDate: Thu Jul 9 12:10:49 2020 +0200

    gpio: fix code style (long lines)
---
 examples/gpio/gpio_main.c | 50 +++++++++++++++++++++++++++++++----------------
 1 file changed, 33 insertions(+), 17 deletions(-)

diff --git a/examples/gpio/gpio_main.c b/examples/gpio/gpio_main.c
index 0bc03f0..ea37041 100644
--- a/examples/gpio/gpio_main.c
+++ b/examples/gpio/gpio_main.c
@@ -56,12 +56,17 @@
 
 static void show_usage(FAR const char *progname)
 {
-  fprintf(stderr, "USAGE: %s [-w <signo>] [-o <value>] <driver-path>\n", 
progname);
+  fprintf(stderr, "USAGE: %s [-w <signo>] [-o <value>] <driver-path>\n",
+          progname);
   fprintf(stderr, "       %s -h\n", progname);
   fprintf(stderr, "Where:\n");
-  fprintf(stderr, "\t<driver-path>: The full path to the GPIO pin driver.\n");
-  fprintf(stderr, "\t-w <signo>: Wait for an signal if this is an interrupt 
pin.\n");
-  fprintf(stderr, "\t-o <value>:  Write this value (0 or 1) if this is an 
output pin.\n");
+  fprintf(stderr, "\t<driver-path>: The full path to the GPIO pin "
+          "driver.\n");
+  fprintf(stderr,
+          "\t-w <signo>: Wait for an signal if this is an interrupt pin.\n");
+  fprintf(stderr,
+          "\t-o <value>:  Write this value (0 or 1) if this is an output "
+          "pin.\n");
   fprintf(stderr, "\t-h: Print this usage information and exit.\n");
 }
 
@@ -176,7 +181,8 @@ int main(int argc, FAR char *argv[])
   if (ret < 0)
     {
       int errcode = errno;
-      fprintf(stderr, "ERROR: Failed to read pintype from %s: %d\n", devpath, 
errcode);
+      fprintf(stderr, "ERROR: Failed to read pintype from %s: %d\n",
+              devpath, errcode);
       close(fd);
       return EXIT_FAILURE;
     }
@@ -187,7 +193,8 @@ int main(int argc, FAR char *argv[])
   if (ret < 0)
     {
       int errcode = errno;
-      fprintf(stderr, "ERROR: Failed to read value from %s: %d\n", devpath, 
errcode);
+      fprintf(stderr, "ERROR: Failed to read value from %s: %d\n",
+              devpath, errcode);
       close(fd);
       return EXIT_FAILURE;
     }
@@ -198,19 +205,22 @@ int main(int argc, FAR char *argv[])
     {
       case GPIO_INPUT_PIN:
         {
-          printf("  Input pin:     Value=%u\n", (unsigned int)invalue);
+          printf("  Input pin:     Value=%u\n",
+                 (unsigned int)invalue);
         }
         break;
 
       case GPIO_INPUT_PIN_PULLUP:
         {
-          printf("  Input pin (pull-up):     Value=%u\n", (unsigned 
int)invalue);
+          printf("  Input pin (pull-up):     Value=%u\n",
+                 (unsigned int)invalue);
         }
         break;
 
       case GPIO_INPUT_PIN_PULLDOWN:
         {
-          printf("  Input pin (pull-down):     Value=%u\n", (unsigned 
int)invalue);
+          printf("  Input pin (pull-down):     Value=%u\n",
+                 (unsigned int)invalue);
         }
         break;
 
@@ -229,7 +239,8 @@ int main(int argc, FAR char *argv[])
               if (ret < 0)
                {
                  int errcode = errno;
-                 fprintf(stderr, "ERROR: Failed to write value %u from %s: 
%d\n",
+                 fprintf(stderr,
+                         "ERROR: Failed to write value %u from %s: %d\n",
                          devpath, (unsigned int)outvalue, errcode);
                  close(fd);
                  return EXIT_FAILURE;
@@ -237,11 +248,13 @@ int main(int argc, FAR char *argv[])
 
               /* Re-read the pin value */
 
-              ret = ioctl(fd, GPIOC_READ, (unsigned 
long)((uintptr_t)&invalue));
+              ret = ioctl(fd, GPIOC_READ,
+                          (unsigned long)((uintptr_t)&invalue));
               if (ret < 0)
                 {
                   int errcode = errno;
-                  fprintf(stderr, "ERROR: Failed to re-read value from %s: 
%d\n",
+                  fprintf(stderr,
+                          "ERROR: Failed to re-read value from %s: %d\n",
                           devpath, errcode);
                   close(fd);
                   return EXIT_FAILURE;
@@ -272,7 +285,8 @@ int main(int argc, FAR char *argv[])
                 {
                   int errcode = errno;
 
-                  fprintf(stderr, "ERROR: Failed to setup for signal from %s: 
%d\n",
+                  fprintf(stderr,
+                          "ERROR: Failed to setup for signal from %s: %d\n",
                           devpath, errcode);
 
                   close(fd);
@@ -301,8 +315,8 @@ int main(int argc, FAR char *argv[])
                     }
                   else
                     {
-                      fprintf(stderr, "ERROR: Failed to wait signal %d from 
%s: %d\n",
-                              signo, devpath, errcode);
+                      fprintf(stderr, "ERROR: Failed to wait signal %d "
+                              "from %s: %d\n", signo, devpath, errcode);
                       close(fd);
                       return EXIT_FAILURE;
                     }
@@ -310,11 +324,13 @@ int main(int argc, FAR char *argv[])
 
               /* Re-read the pin value */
 
-              ret = ioctl(fd, GPIOC_READ, (unsigned 
long)((uintptr_t)&invalue));
+              ret = ioctl(fd, GPIOC_READ,
+                          (unsigned long)((uintptr_t)&invalue));
               if (ret < 0)
                 {
                   int errcode = errno;
-                  fprintf(stderr, "ERROR: Failed to re-read value from %s: 
%d\n",
+                  fprintf(stderr,
+                          "ERROR: Failed to re-read value from %s: %d\n",
                           devpath, errcode);
                   close(fd);
                   return EXIT_FAILURE;

Reply via email to