27 lines
671 B
C++
27 lines
671 B
C++
#include <bsp_q7s/gpio/cookies/GpioCookie.h>
|
|
#include <fsfw/serviceinterface/ServiceInterfaceStream.h>
|
|
|
|
GpioCookie::GpioCookie() {
|
|
}
|
|
|
|
void GpioCookie::addGpio(gpioId_t gpioId, GpioConfig_t gpioConfig){
|
|
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;
|
|
}
|
|
}
|
|
else {
|
|
sif::error << "GpioCookie::addGpio: GPIO already exists in GPIO map "
|
|
<< std::endl;
|
|
}
|
|
}
|
|
|
|
GpioMap GpioCookie::getGpioMap() const{
|
|
return gpioMap;
|
|
}
|
|
|
|
GpioCookie::~GpioCookie() {}
|