implemented dtors
This commit is contained in:
parent
a12f036339
commit
ee08658f55
@ -42,4 +42,8 @@ GpioMap GpioCookie::getGpioMap() const {
|
|||||||
return gpioMap;
|
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() {
|
LinuxLibgpioIF::~LinuxLibgpioIF() {
|
||||||
|
for(auto& config: gpioMap) {
|
||||||
|
delete(config.second);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ReturnValue_t LinuxLibgpioIF::addGpios(GpioCookie* gpioCookie) {
|
ReturnValue_t LinuxLibgpioIF::addGpios(GpioCookie* gpioCookie) {
|
||||||
|
@ -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