mstroh76 6ヶ月前
コミット
23b7251a2d
3個のファイルの変更7行の追加7行の削除
  1. +1
    -1
      gpio/gpio.c
  2. +4
    -4
      wiringPi/wiringPi.c
  3. +2
    -2
      wiringPi/wiringPi.h

+ 1
- 1
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") ;
}



+ 4
- 4
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 ;


+ 2
- 2
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) ;


読み込み中…
キャンセル
保存