added back member iter
This commit is contained in:
parent
cc9bb7a2c5
commit
24a251cd1c
@ -39,7 +39,6 @@ ReturnValue_t LinuxLibgpioIF::initialize(GpioCookie* gpioCookie){
|
|||||||
}
|
}
|
||||||
|
|
||||||
ReturnValue_t LinuxLibgpioIF::configureGpios(GpioMap& mapToAdd) {
|
ReturnValue_t LinuxLibgpioIF::configureGpios(GpioMap& mapToAdd) {
|
||||||
//GpioMapIter mapToAddIter;
|
|
||||||
std::string chipname;
|
std::string chipname;
|
||||||
unsigned int lineNum;
|
unsigned int lineNum;
|
||||||
struct gpiod_chip *chip;
|
struct gpiod_chip *chip;
|
||||||
@ -48,9 +47,7 @@ ReturnValue_t LinuxLibgpioIF::configureGpios(GpioMap& mapToAdd) {
|
|||||||
struct gpiod_line *lineHandle;
|
struct gpiod_line *lineHandle;
|
||||||
int result;
|
int result;
|
||||||
|
|
||||||
//mapToAddIter = mapToAdd->begin();
|
|
||||||
for(auto& gpioConfig: mapToAdd) {
|
for(auto& gpioConfig: mapToAdd) {
|
||||||
//for (; mapToAddIter != mapToAdd->end(); mapToAddIter++) {
|
|
||||||
chipname = gpioConfig.second.chipname;
|
chipname = gpioConfig.second.chipname;
|
||||||
chip = gpiod_chip_open_by_name(chipname.c_str());
|
chip = gpiod_chip_open_by_name(chipname.c_str());
|
||||||
if (!chip) {
|
if (!chip) {
|
||||||
@ -119,7 +116,7 @@ ReturnValue_t LinuxLibgpioIF::driveGpio(gpioId_t gpioId,
|
|||||||
int result;
|
int result;
|
||||||
struct gpiod_line *lineHandle;
|
struct gpiod_line *lineHandle;
|
||||||
|
|
||||||
auto gpioMapIter = gpioMap.find(gpioId);
|
gpioMapIter = gpioMap.find(gpioId);
|
||||||
if (gpioMapIter == gpioMap.end()){
|
if (gpioMapIter == gpioMap.end()){
|
||||||
sif::debug << "LinuxLibgpioIF::driveGpio: Unknown gpio id " << gpioId << std::endl;
|
sif::debug << "LinuxLibgpioIF::driveGpio: Unknown gpio id " << gpioId << std::endl;
|
||||||
return RETURN_FAILED;
|
return RETURN_FAILED;
|
||||||
@ -139,7 +136,7 @@ ReturnValue_t LinuxLibgpioIF::driveGpio(gpioId_t gpioId,
|
|||||||
ReturnValue_t LinuxLibgpioIF::readGpio(gpioId_t gpioId, int* gpioState) {
|
ReturnValue_t LinuxLibgpioIF::readGpio(gpioId_t gpioId, int* gpioState) {
|
||||||
struct gpiod_line *lineHandle;
|
struct gpiod_line *lineHandle;
|
||||||
|
|
||||||
auto gpioMapIter = gpioMap.find(gpioId);
|
gpioMapIter = gpioMap.find(gpioId);
|
||||||
if (gpioMapIter == gpioMap.end()){
|
if (gpioMapIter == gpioMap.end()){
|
||||||
sif::debug << "LinuxLibgpioIF::readGpio: Unknown gpio id " << gpioId << std::endl;
|
sif::debug << "LinuxLibgpioIF::readGpio: Unknown gpio id " << gpioId << std::endl;
|
||||||
return RETURN_FAILED;
|
return RETURN_FAILED;
|
||||||
@ -153,7 +150,6 @@ ReturnValue_t LinuxLibgpioIF::readGpio(gpioId_t gpioId, int* gpioState) {
|
|||||||
|
|
||||||
ReturnValue_t LinuxLibgpioIF::checkForConflicts(GpioMap& mapToAdd){
|
ReturnValue_t LinuxLibgpioIF::checkForConflicts(GpioMap& mapToAdd){
|
||||||
gpioId_t gpioId;
|
gpioId_t gpioId;
|
||||||
auto gpioMapIter = gpioMap.begin();
|
|
||||||
for(auto& gpioConfig: mapToAdd) {
|
for(auto& gpioConfig: mapToAdd) {
|
||||||
gpioId = gpioConfig.first;
|
gpioId = gpioConfig.first;
|
||||||
/* Cross check with private map */
|
/* Cross check with private map */
|
||||||
|
@ -32,6 +32,7 @@ public:
|
|||||||
private:
|
private:
|
||||||
/* Holds the information and configuration of all used GPIOs */
|
/* Holds the information and configuration of all used GPIOs */
|
||||||
GpioMap gpioMap;
|
GpioMap gpioMap;
|
||||||
|
GpioMapIter gpioMapIter;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief This functions drives line of a GPIO specified by the GPIO ID.
|
* @brief This functions drives line of a GPIO specified by the GPIO ID.
|
||||||
|
Loading…
Reference in New Issue
Block a user