fixed RPI GPIO code

This commit is contained in:
Robin Müller 2021-04-10 22:20:55 +02:00
parent a12f036339
commit 14fe32572d

View File

@ -11,14 +11,14 @@ ReturnValue_t gpio::createRpiGpioConfig(GpioCookie* cookie, gpioId_t gpioId, int
return HasReturnvaluesIF::RETURN_FAILED;
}
GpiodRegular config;
GpiodRegular* config = new GpiodRegular();
/* Default chipname for Raspberry Pi. There is still gpiochip1 for expansion, but most users
will not need this */
config.chipname = "gpiochip0";
config->chipname = "gpiochip0";
config.consumer = consumer;
config.direction = direction;
config.initValue = initValue;
config->consumer = consumer;
config->direction = direction;
config->initValue = initValue;
/* Sanity check for the BCM pins before assigning it */
if(bcmPin > 27) {
@ -31,7 +31,7 @@ ReturnValue_t gpio::createRpiGpioConfig(GpioCookie* cookie, gpioId_t gpioId, int
#endif /* FSFW_VERBOSE_LEVEL >= 1 */
return HasReturnvaluesIF::RETURN_FAILED;
}
config.lineNum = bcmPin;
config->lineNum = bcmPin;
cookie->addGpio(gpioId, config);
return HasReturnvaluesIF::RETURN_OK;
}