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