gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[taler-taler-mdb] branch master updated: unexport gpio when done


From: gnunet
Subject: [taler-taler-mdb] branch master updated: unexport gpio when done
Date: Wed, 18 May 2022 18:42:47 +0200

This is an automated email from the git hooks/post-receive script.

grothoff pushed a commit to branch master
in repository taler-mdb.

The following commit(s) were added to refs/heads/master by this push:
     new 16bc3d2  unexport gpio when done
16bc3d2 is described below

commit 16bc3d26021925542787dd1f52204cd689a13051
Author: Christian Grothoff <christian@grothoff.org>
AuthorDate: Wed May 18 18:42:45 2022 +0200

    unexport gpio when done
---
 src/main.c | 31 ++++++++++++++++++++++++++++++-
 1 file changed, 30 insertions(+), 1 deletion(-)

diff --git a/src/main.c b/src/main.c
index c90b946..756f166 100644
--- a/src/main.c
+++ b/src/main.c
@@ -1202,6 +1202,36 @@ shutdown_task (void *cls)
                        products_length,
                        0);
   }
+  if (have_gpio)
+  {
+    /* release gpio pin for cancel button */
+    int efd;
+
+    efd = open ("/sys/class/gpio/unexport",
+                O_WRONLY);
+    if (-1 == efd)
+    {
+      GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
+                  "Unable to open /gpio/unexport for cancel button\n");
+      have_gpio = false;
+    }
+    else
+    {
+      if (2 != write (efd,
+                      "23",
+                      2))
+      {
+        GNUNET_log_strerror_file (GNUNET_ERROR_TYPE_WARNING,
+                                  "write",
+                                  "/sys/class/gpio/unexport");
+      }
+      else
+      {
+        have_gpio = true;
+      }
+      GNUNET_assert (0 == close (efd));
+    }
+  }
   GNUNET_log (GNUNET_ERROR_TYPE_INFO,
               "Shutdown complete (except for MDB)\n");
 }
@@ -3170,7 +3200,6 @@ run (void *cls,
         GNUNET_log_strerror_file (GNUNET_ERROR_TYPE_WARNING,
                                   "write",
                                   "/sys/class/gpio/export");
-        have_gpio = false;
       }
       else
       {

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]