linux HAL fixes

This commit is contained in:
Robin Müller 2021-12-09 13:42:54 +01:00
parent e4999fe01c
commit bda02b464a
No known key found for this signature in database
GPG Key ID: 11D4952C8CCEF814

View File

@ -75,7 +75,7 @@ ReturnValue_t LinuxLibgpioIF::configureGpios(GpioMap& mapToAdd) {
configureGpioByLineName(gpioConfig.first, *regularGpio);
break;
}
case(gpio::GpioTypes::CALLBACK): {
case(gpio::GpioTypes::TYPE_CALLBACK): {
auto gpioCallback = dynamic_cast<GpioCallback*>(gpioConfig.second);
if(gpioCallback->callback == nullptr) {
return GPIO_INVALID_INSTANCE;
@ -163,12 +163,12 @@ ReturnValue_t LinuxLibgpioIF::configureRegularGpio(gpioId_t gpioId, struct gpiod
consumer = regularGpio.consumer;
/* Configure direction and add a description to the GPIO */
switch (direction) {
case(gpio::OUT): {
case(gpio::DIR_OUT): {
result = gpiod_line_request_output(lineHandle, consumer.c_str(),
regularGpio.initValue);
break;
}
case(gpio::IN): {
case(gpio::DIR_IN): {
result = gpiod_line_request_input(lineHandle, consumer.c_str());
break;
}
@ -330,7 +330,7 @@ ReturnValue_t LinuxLibgpioIF::checkForConflicts(GpioMap& mapToAdd){
}
break;
}
case(gpio::GpioTypes::CALLBACK): {
case(gpio::GpioTypes::TYPE_CALLBACK): {
auto callbackGpio = dynamic_cast<GpioCallback*>(gpioConfig.second);
if(callbackGpio == nullptr) {
return GPIO_TYPE_FAILURE;
@ -371,13 +371,13 @@ ReturnValue_t LinuxLibgpioIF::checkForConflictsById(gpioId_t gpioIdToCheck,
case(gpio::GpioTypes::GPIO_REGULAR_BY_CHIP):
case(gpio::GpioTypes::GPIO_REGULAR_BY_LABEL):
case(gpio::GpioTypes::GPIO_REGULAR_BY_LINE_NAME): {
if(gpioType == gpio::GpioTypes::NONE or gpioType == gpio::GpioTypes::CALLBACK) {
if(gpioType == gpio::GpioTypes::NONE or gpioType == gpio::GpioTypes::TYPE_CALLBACK) {
eraseDuplicateDifferentType = true;
}
break;
}
case(gpio::GpioTypes::CALLBACK): {
if(gpioType != gpio::GpioTypes::CALLBACK) {
case(gpio::GpioTypes::TYPE_CALLBACK): {
if(gpioType != gpio::GpioTypes::TYPE_CALLBACK) {
eraseDuplicateDifferentType = true;
}
}