added new linux folder

This commit is contained in:
2021-02-14 12:35:08 +01:00
parent ae47acdbbb
commit 56c89a0751
11 changed files with 62 additions and 53 deletions

26
linux/gpio/GpioCookie.cpp Normal file
View File

@ -0,0 +1,26 @@
#include "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() {}