fixed RPI GPIO code
This commit is contained in:
parent
a12f036339
commit
14fe32572d
@ -11,14 +11,14 @@ ReturnValue_t gpio::createRpiGpioConfig(GpioCookie* cookie, gpioId_t gpioId, int
|
|||||||
return HasReturnvaluesIF::RETURN_FAILED;
|
return HasReturnvaluesIF::RETURN_FAILED;
|
||||||
}
|
}
|
||||||
|
|
||||||
GpiodRegular config;
|
GpiodRegular* config = new GpiodRegular();
|
||||||
/* Default chipname for Raspberry Pi. There is still gpiochip1 for expansion, but most users
|
/* Default chipname for Raspberry Pi. There is still gpiochip1 for expansion, but most users
|
||||||
will not need this */
|
will not need this */
|
||||||
config.chipname = "gpiochip0";
|
config->chipname = "gpiochip0";
|
||||||
|
|
||||||
config.consumer = consumer;
|
config->consumer = consumer;
|
||||||
config.direction = direction;
|
config->direction = direction;
|
||||||
config.initValue = initValue;
|
config->initValue = initValue;
|
||||||
|
|
||||||
/* Sanity check for the BCM pins before assigning it */
|
/* Sanity check for the BCM pins before assigning it */
|
||||||
if(bcmPin > 27) {
|
if(bcmPin > 27) {
|
||||||
@ -31,7 +31,7 @@ ReturnValue_t gpio::createRpiGpioConfig(GpioCookie* cookie, gpioId_t gpioId, int
|
|||||||
#endif /* FSFW_VERBOSE_LEVEL >= 1 */
|
#endif /* FSFW_VERBOSE_LEVEL >= 1 */
|
||||||
return HasReturnvaluesIF::RETURN_FAILED;
|
return HasReturnvaluesIF::RETURN_FAILED;
|
||||||
}
|
}
|
||||||
config.lineNum = bcmPin;
|
config->lineNum = bcmPin;
|
||||||
cookie->addGpio(gpioId, config);
|
cookie->addGpio(gpioId, config);
|
||||||
return HasReturnvaluesIF::RETURN_OK;
|
return HasReturnvaluesIF::RETURN_OK;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user