From 3871ccc77c1ff3cd696757f94e975c3951c7466d Mon Sep 17 00:00:00 2001 From: Cel Skeggs Date: Mon, 6 Jan 2025 09:14:13 -0800 Subject: [PATCH] Fix LinuxGpioDriver build w/ disabled object names (#3103) When F Prime is configured with FW_OBJECT_NAMES == 0, the getObjName() function is not available, which causes a failure to build. --- Drv/LinuxGpioDriver/LinuxGpioDriver.cpp | 4 ++-- Drv/LinuxGpioDriver/LinuxGpioDriverCommon.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Drv/LinuxGpioDriver/LinuxGpioDriver.cpp b/Drv/LinuxGpioDriver/LinuxGpioDriver.cpp index b8e078a6f0..e0d69a56a1 100644 --- a/Drv/LinuxGpioDriver/LinuxGpioDriver.cpp +++ b/Drv/LinuxGpioDriver/LinuxGpioDriver.cpp @@ -139,7 +139,7 @@ Os::File::Status LinuxGpioDriver ::setupLineHandle(const PlatformIntType chip_de struct gpiohandle_request request; (void) ::memset(&request, 0, sizeof request); request.lineoffsets[0] = gpio; - Fw::StringUtils::string_copy(request.consumer_label, this->getObjName(), + Fw::StringUtils::string_copy(request.consumer_label, FW_OPTIONAL_NAME(this->getObjName()), static_cast(sizeof request.consumer_label)); request.default_values[0] = (default_state == Fw::Logic::HIGH) ? 1 : 0; request.fd = -1; @@ -165,7 +165,7 @@ Os::File::Status LinuxGpioDriver ::setupLineEvent(const PlatformIntType chip_des struct gpioevent_request event; (void) ::memset(&event, 0, sizeof event); event.lineoffset = gpio; - Fw::StringUtils::string_copy(event.consumer_label, this->getObjName(), + Fw::StringUtils::string_copy(event.consumer_label, FW_OPTIONAL_NAME(this->getObjName()), static_cast(sizeof event.consumer_label)); event.fd = -1; event.handleflags = configuration_to_handler_flags(configuration); diff --git a/Drv/LinuxGpioDriver/LinuxGpioDriverCommon.cpp b/Drv/LinuxGpioDriver/LinuxGpioDriverCommon.cpp index 8c8cf23cba..8301e71b3b 100644 --- a/Drv/LinuxGpioDriver/LinuxGpioDriverCommon.cpp +++ b/Drv/LinuxGpioDriver/LinuxGpioDriverCommon.cpp @@ -34,7 +34,7 @@ Drv::GpioStatus LinuxGpioDriver ::start(const FwSizeType priority, this->m_running = true; } Fw::String name; - name.format("%s.interrupt", this->getObjName()); + name.format("%s.interrupt", FW_OPTIONAL_NAME(this->getObjName())); Os::Task::Arguments arguments(name, &this->interruptFunction, this, priority, stackSize, cpuAffinity, identifier); this->m_poller.start(arguments);