summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2021-03-04 14:20:29 +0100
committerErich Eckner <git@eckner.net>2021-03-04 14:20:29 +0100
commit2ac4843a974822a0b547b52a274d13ac39374b9e (patch)
treea720985f76f05f9fcd46d89f645bd612a3ecae65
parent5f036f9ac828ef2620593ae743ffcc53ec410fcb (diff)
downloadanzeige-2ac4843a974822a0b547b52a274d13ac39374b9e.tar.xz
multiplexer.[ch]: make global variables "extern" to the .h and repeat in the .c
-rw-r--r--multiplexer.c4
-rw-r--r--multiplexer.h6
2 files changed, 7 insertions, 3 deletions
diff --git a/multiplexer.c b/multiplexer.c
index d0ae7c7..c893ca3 100644
--- a/multiplexer.c
+++ b/multiplexer.c
@@ -11,6 +11,10 @@
#include "multiplexer.h"
+int mem_fd;
+void *gpio_map;
+volatile unsigned *gpio;
+
//
// Set up a memory regions to access GPIO
//
diff --git a/multiplexer.h b/multiplexer.h
index 3fb1f87..00c1113 100644
--- a/multiplexer.h
+++ b/multiplexer.h
@@ -52,8 +52,8 @@ static uint8_t gpioToPUDCLK [] =
static int tpic_settle_time_iterator = 1000;
#define wait_tpic_settle_time for (int i=0; i<tpic_settle_time_iterator; i++) { asm volatile("" : : "r" (i)); }
-int mem_fd;
-void *gpio_map;
+extern int mem_fd;
+extern void *gpio_map;
typedef struct {
char buf[3][40];
@@ -75,7 +75,7 @@ typedef struct {
} t_scroll_data;
// I/O access
-volatile unsigned *gpio;
+extern volatile unsigned *gpio;
// GPIO setup macros. Always use INP_GPIO(x) before using OUT_GPIO(x) or SET_GPIO_ALT(x,y)
#define INP_GPIO(g) *(gpio+((g)/10)) &= ~(7<<(((g)%10)*3))