Skip to content

Commit

Permalink
Add changes to GpioDriver for nasa/fprime#2943 (#78)
Browse files Browse the repository at this point in the history
* Fixing LedBlinker workshop for new GPIO driver

* Fixing UT breakage

---------

Co-authored-by: Michael D Starch <[email protected]>
  • Loading branch information
thomas-bc and LeStarch authored Oct 15, 2024
1 parent 65ddedd commit 10ef6c1
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 7 deletions.
3 changes: 2 additions & 1 deletion Components/Led/test/ut/LedTester.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,9 @@ void LedTester ::testBlinkInterval() {
// Handlers for typed from ports
// ----------------------------------------------------------------------

void LedTester ::from_gpioSet_handler(const NATIVE_INT_TYPE portNum, const Fw::Logic& state) {
Drv::GpioStatus LedTester ::from_gpioSet_handler(const NATIVE_INT_TYPE portNum, const Fw::Logic& state) {
this->pushFromPortEntry_gpioSet(state);
return Drv::GpioStatus::OP_OK;
}

} // end namespace Components
4 changes: 2 additions & 2 deletions Components/Led/test/ut/LedTester.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ class LedTester : public LedGTestBase {

//! Handler for from_gpioSet
//!
void from_gpioSet_handler(const NATIVE_INT_TYPE portNum, /*!< The port number*/
const Fw::Logic& state);
Drv::GpioStatus from_gpioSet_handler(const NATIVE_INT_TYPE portNum, /*!< The port number*/
const Fw::Logic& state);

private:
// ----------------------------------------------------------------------
Expand Down
6 changes: 3 additions & 3 deletions LedBlinker/Top/LedBlinkerTopology.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -111,9 +111,9 @@ void configureTopology() {

// Note: Uncomment when using Svc:TlmPacketizer
// tlmSend.setPacketList(LedBlinkerPacketsPkts, LedBlinkerPacketsIgnore, 1);
bool gpio_success = gpioDriver.open(13, Drv::LinuxGpioDriver::GpioDirection::GPIO_OUT);
if (!gpio_success) {
Fw::Logger::log("[ERROR] Failed to open GPIO pin\n");
Os::File::Status gpio_success = gpioDriver.open("/dev/gpiochip0", 13, Drv::LinuxGpioDriver::GpioConfiguration::GPIO_OUTPUT);
if (gpio_success != Os::File::Status::OP_OK) {
Fw::Logger::log("[ERROR] Failed to open GPIO pin: %d\n", gpio_success);
}
}

Expand Down
2 changes: 1 addition & 1 deletion fprime
Submodule fprime updated 1102 files

0 comments on commit 10ef6c1

Please sign in to comment.