]> git.rkrishnan.org Git - pihpsdr.git/commitdiff
Activate "helper functions" for debouncing in GPIO case only.
authorc vw <dl1ycf@darc.de>
Wed, 5 Jan 2022 14:40:54 +0000 (15:40 +0100)
committerc vw <dl1ycf@darc.de>
Wed, 5 Jan 2022 14:40:54 +0000 (15:40 +0100)
gpio.c
gpio.h

diff --git a/gpio.c b/gpio.c
index 7bf0feffc086bf4ff2e53f8e040f03eae362060f..9d97f78fbe718db7faa46c27beeb3b91f61c1a24 100644 (file)
--- a/gpio.c
+++ b/gpio.c
@@ -341,6 +341,7 @@ static GThread *rotary_encoder_thread_id;
 
 static uint64_t epochMilli;
 
+#ifdef GPIO
 static void initialiseEpoch() {
   struct timespec ts ;
 
@@ -355,6 +356,7 @@ unsigned int millis () {
   now  = (uint64_t)ts.tv_sec * (uint64_t)1000 + (uint64_t)(ts.tv_nsec / 1000000L) ;
   return (uint32_t)(now - epochMilli) ;
 }
+#endif
 
 static gpointer rotary_encoder_thread(gpointer data) {
   int i;
diff --git a/gpio.h b/gpio.h
index 00bf52a1b99fac6755ef3cfc66b6470ebaad0dbd..e6e926dd3788932b54828613070b6d40c2e51b78 100644 (file)
--- a/gpio.h
+++ b/gpio.h
@@ -79,7 +79,9 @@ extern void gpio_save_state(void);
 extern void gpio_save_actions(void);
 extern int gpio_init(void);
 extern void gpio_close(void);
+#ifdef GPIO
 extern unsigned int millis(void); // to allow debouncing in i2c.c 
+#endif
 
 #ifdef LOCALCW
 extern int CWL_BUTTON;