From 1f483938e64c06de62f589b4bb87ecd069840824 Mon Sep 17 00:00:00 2001 From: Siegfried Kienzle Date: Tue, 25 Apr 2017 07:48:18 +0200 Subject: [PATCH] add function registerInput --- project/gpio.c | 6 ++++++ project/gpio.h | 1 + 2 files changed, 7 insertions(+) diff --git a/project/gpio.c b/project/gpio.c index eae9a47..c62152d 100644 --- a/project/gpio.c +++ b/project/gpio.c @@ -40,6 +40,12 @@ void registerOutput(char *pin) setDirection(pin, "out", 3); } +void registerInput(char *pin) +{ + registerPin(pin); + setDirection(pin, "in", 3); +} + void writeOutput(char *pin, int state) { char path[50]; diff --git a/project/gpio.h b/project/gpio.h index 656ac0b..d60543f 100644 --- a/project/gpio.h +++ b/project/gpio.h @@ -10,6 +10,7 @@ void registerPin(char *pin); void freePin(char *pin); void setDirection(char *pin, char *direction, int dirlen); void registerOutput(char *pin); +void registerInput(char *pin); void writeOutput(char *pin, int state); #endif \ No newline at end of file