diff options
-rw-r--r-- | bus.c | 3 |
1 files changed, 1 insertions, 2 deletions
@@ -60,7 +60,6 @@ static int devmemfd = -1; static bool util_isbeaglebone() { - bool ret = false; int fd = open("/sys/kernel/debug/omap_mux/board/core", O_RDONLY); close(fd); return fd > -1; @@ -272,10 +271,10 @@ static void gpio_getvaluenodepath(unsigned base, unsigned io, char* buffer) static int gpio_readvalue(unsigned base, unsigned io) { char path[PATHLEN]; - char value[2]; // value will be a single char and \n gpio_getvaluenodepath(base, io, path); FILE* valuefile = fopen(path, "r"); if (valuefile != NULL) { + char value[2]; // value will be a single char and \n fread(value, 1, 2, valuefile); fclose(valuefile); return atoi(value); |