eive-obsw/bsp_q7s/comIF/cookies/GpioCookie.cpp

27 lines
623 B
C++
Raw Normal View History

2021-01-16 12:22:17 +01:00
#include <bsp_q7s/comIF/cookies/GpioCookie.h>
GpioCookie::GpioCookie() {
}
void GpioCookie::addGpio(gpioMap newEntry){
gpioMapIter = gpioMap.find(newEntry);
if(gpioMapIter == gpioMap.end()) {
std::pair status = i2cDeviceMap.emplace(newEntry);
if (status.second == false) {
sif::error << "GpioCookie::addGpio: Failed to add GPIO "
<< newEntry.first << "to GPIO map" << std::endl;
return HasReturnvaluesIF::RETURN_OK;
}
}
else {
sif::error << "GpioCookie::addGpio: GPIO already exists in GPIO map "
<< std::endl;
}
}
GpioMap getGpioMap() const{
return gpioMap;
}
GpioCookie::~GpioCookie() {}