From 23b7251a2dc71f8c823340895c54ab6530e33f41 Mon Sep 17 00:00:00 2001 From: mstroh76 Date: Fri, 3 May 2024 14:36:09 +0200 Subject: [PATCH] #227 --- gpio/gpio.c | 2 +- wiringPi/wiringPi.c | 8 ++++---- wiringPi/wiringPi.h | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/gpio/gpio.c b/gpio/gpio.c index 0e49560..fae1b79 100644 --- a/gpio/gpio.c +++ b/gpio/gpio.c @@ -1138,7 +1138,7 @@ static void doVersion (char *argv []) printf (" * root or sudo may be required for direct GPIO access.\n") ; } } - if (GetChipFd()>0) { + if (wiringPiGpioDeviceGetFd()>0) { printf (" * Supports basic user-level GPIO access via /dev/gpiochip (slow).\n") ; } diff --git a/wiringPi/wiringPi.c b/wiringPi/wiringPi.c index 1d802bd..7d7b503 100644 --- a/wiringPi/wiringPi.c +++ b/wiringPi/wiringPi.c @@ -1503,7 +1503,7 @@ void pinEnableED01Pi (int pin) const char DEV_GPIO_PI[] ="/dev/gpiochip0"; const char DEV_GPIO_PI5[]="/dev/gpiochip4"; -int GetChipFd() { +int wiringPiGpioDeviceGetFd() { if (chipFd<0) { piBoard(); const char* gpiochip = PI_MODEL_5 == RaspberryPiModel ? DEV_GPIO_PI5 : DEV_GPIO_PI; @@ -1540,7 +1540,7 @@ int requestLine(int pin, unsigned int lineRequestFlags) { } //requested line - if (GetChipFd()<0) { + if (wiringPiGpioDeviceGetFd()<0) { return -1; // error } rq.lineoffsets[0] = pin; @@ -2338,7 +2338,7 @@ int waitForInterruptInit (int pin, int mode) /* open gpio */ sleep(1); - if (GetChipFd()<0) { + if (wiringPiGpioDeviceGetFd()<0) { return -1; } @@ -3052,7 +3052,7 @@ int wiringPiSetupGpioDevice (enum WPIPinType pinType) { if (getenv (ENV_CODES) != NULL) wiringPiReturnCodes = TRUE ; - if (GetChipFd()<0) { + if (wiringPiGpioDeviceGetFd()<0) { return -1; } wiringPiSetuped = TRUE ; diff --git a/wiringPi/wiringPi.h b/wiringPi/wiringPi.h index f90b582..9bd749f 100644 --- a/wiringPi/wiringPi.h +++ b/wiringPi/wiringPi.h @@ -216,7 +216,7 @@ enum WPIPinType { }; extern void wiringPiVersion (int *major, int *minor) ; -extern int wiringPiGlobalMemoryAccess(void); //Interface V3.3 +extern int wiringPiGlobalMemoryAccess(void); //Interface V3.3 extern int wiringPiUserLevelAccess (void) ; extern int wiringPiSetup (void) ; extern int wiringPiSetupSys (void) ; @@ -225,7 +225,7 @@ extern int wiringPiSetupPhys (void) ; extern int wiringPiSetupPinType (enum WPIPinType pinType); //Interface V3.3 extern int wiringPiSetupGpioDevice(enum WPIPinType pinType); //Interface V3.3 -extern int GetChipFd (); +extern int wiringPiGpioDeviceGetFd(); //Interface V3.3 extern void pinModeAlt (int pin, int mode) ; extern void pinMode (int pin, int mode) ; extern void pullUpDnControl (int pin, int pud) ;