some minor improvements

This commit is contained in:
2021-02-14 18:21:59 +01:00
parent 9a995a9b5c
commit fc0337af04
5 changed files with 59 additions and 61 deletions

View File

@ -1,25 +1,23 @@
#include "GpioCookie.h"
#include <fsfw/serviceinterface/ServiceInterfaceStream.h>
#include <fsfw/serviceinterface/ServiceInterface.h>
GpioCookie::GpioCookie() {
}
void GpioCookie::addGpio(gpioId_t gpioId, GpioConfig_t gpioConfig){
gpioMapIter = gpioMap.find(gpioId);
auto gpioMapIter = gpioMap.find(gpioId);
if(gpioMapIter == gpioMap.end()) {
std::pair status = gpioMap.emplace(gpioId, gpioConfig);
if (status.second == false) {
sif::error << "GpioCookie::addGpio: Failed to add GPIO "
<< gpioId << "to GPIO map" << std::endl;
auto statusPair = gpioMap.emplace(gpioId, gpioConfig);
if (statusPair.second == false) {
sif::error << "GpioCookie::addGpio: Failed to add GPIO " << gpioId <<
"to GPIO map" << std::endl;
}
return;
}
else {
sif::error << "GpioCookie::addGpio: GPIO already exists in GPIO map "
<< std::endl;
}
sif::error << "GpioCookie::addGpio: GPIO already exists in GPIO map " << std::endl;
}
GpioMap& GpioCookie::getGpioMap() const {
GpioMap GpioCookie::getGpioMap() const {
return gpioMap;
}