Skip to content

Commit

Permalink
Fix LinuxGpioDriver build w/ disabled object names (#3103)
Browse files Browse the repository at this point in the history
When F Prime is configured with FW_OBJECT_NAMES == 0, the getObjName()
function is not available, which causes a failure to build.
  • Loading branch information
celskeggs authored Jan 6, 2025
1 parent 231cfdb commit 3871ccc
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions Drv/LinuxGpioDriver/LinuxGpioDriver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<FwSizeType>(sizeof request.consumer_label));
request.default_values[0] = (default_state == Fw::Logic::HIGH) ? 1 : 0;
request.fd = -1;
Expand All @@ -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<FwSizeType>(sizeof event.consumer_label));
event.fd = -1;
event.handleflags = configuration_to_handler_flags(configuration);
Expand Down
2 changes: 1 addition & 1 deletion Drv/LinuxGpioDriver/LinuxGpioDriverCommon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 3871ccc

Please sign in to comment.