implemented dtors
This commit is contained in:
parent
a12f036339
commit
ee08658f55
@ -42,4 +42,8 @@ GpioMap GpioCookie::getGpioMap() const {
|
||||
return gpioMap;
|
||||
}
|
||||
|
||||
GpioCookie::~GpioCookie() {}
|
||||
GpioCookie::~GpioCookie() {
|
||||
for(auto& config: gpioMap) {
|
||||
delete(config.second);
|
||||
}
|
||||
}
|
||||
|
@ -12,6 +12,9 @@ LinuxLibgpioIF::LinuxLibgpioIF(object_id_t objectId) : SystemObject(objectId) {
|
||||
}
|
||||
|
||||
LinuxLibgpioIF::~LinuxLibgpioIF() {
|
||||
for(auto& config: gpioMap) {
|
||||
delete(config.second);
|
||||
}
|
||||
}
|
||||
|
||||
ReturnValue_t LinuxLibgpioIF::addGpios(GpioCookie* gpioCookie) {
|
||||
|
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user