Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into refac
Browse files Browse the repository at this point in the history
  • Loading branch information
pjueon committed Feb 7, 2022
2 parents 603e4d5 + d3bc84c commit 114064b
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 11 deletions.
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ include(GNUInstallDirs)
SET(CMAKE_CXX_STANDARD 14)

option(BUILD_EXAMPLES "Build examples" OFF)
option(POST_INSTALL "Create gpio group and reload udev rules" ON)
option(JETSON_GPIO_POST_INSTALL "Create gpio group and reload udev rules" ON)

SET (UDEVRULES_INSTALL_DIR "/lib/udev/rules.d" CACHE STRING "Base directory for udev rules")

Expand Down Expand Up @@ -90,7 +90,7 @@ install(FILES
install (FILES ${CMAKE_CURRENT_SOURCE_DIR}/99-gpio.rules DESTINATION ${UDEVRULES_INSTALL_DIR})

# Run post installation script
if (POST_INSTALL)
if (JETSON_GPIO_POST_INSTALL)
install (CODE "execute_process(COMMAND bash ./post_install.sh WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})")
endif()

Expand Down
2 changes: 1 addition & 1 deletion include/private/gpio_event.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ namespace GPIO

int _add_edge_detect(int gpio, const std::string& gpio_name, const std::string& channel_id, Edge edge,
uint64_t bounce_time);
void _remove_edge_detect(int gpio, const std::string& gpio_name);
void _remove_edge_detect(int gpio);

int _add_edge_callback(int gpio, const Callback& callback);
void _remove_edge_callback(int gpio, const Callback& callback);
Expand Down
2 changes: 1 addition & 1 deletion src/JetsonGPIO.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -772,7 +772,7 @@ void GPIO::remove_event_detect(const std::string& channel)
{
ChannelInfo ch_info = _channel_to_info(channel, true);

_remove_edge_detect(ch_info.gpio, ch_info.gpio_name);
_remove_edge_detect(ch_info.gpio);
}

void GPIO::remove_event_detect(int channel) { remove_event_detect(std::to_string(channel)); }
Expand Down
6 changes: 3 additions & 3 deletions src/gpio_event.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -563,7 +563,7 @@ namespace GPIO
else
{
// Set for removal from the concurrent epoll-thread
_remove_edge_detect(gpio, gpio_name);
_remove_edge_detect(gpio);
}
}
}
Expand Down Expand Up @@ -790,7 +790,7 @@ namespace GPIO
return 0;
}

void _remove_edge_detect(int gpio, const std::string& gpio_name)
void _remove_edge_detect(int gpio)
{
// Enter Mutex
std::unique_lock<std::recursive_mutex> mutex_lock(_epmutex);
Expand Down Expand Up @@ -862,6 +862,6 @@ namespace GPIO
}
}

void _event_cleanup(int gpio, const std::string& gpio_name) { _remove_edge_detect(gpio, gpio_name); }
void _event_cleanup(int gpio, const std::string& gpio_name) { _remove_edge_detect(gpio); }

} // namespace GPIO
2 changes: 1 addition & 1 deletion src/gpio_pin_data.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,7 @@ namespace GPIO
{ JETSON_TX1, {1, "4096M", "Unknown", "Jetson TX1", "NVIDIA", "ARM A57"} },
{ JETSON_NANO, {1, "4096M", "Unknown", "Jetson nano", "NVIDIA", "ARM A57"} }
}
{};
{}

// clang-format on

Expand Down
6 changes: 3 additions & 3 deletions tests/test_event_module.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,21 +62,21 @@ inline void delay(int ms)
exit(0);
}

void signalHandler(int s) { end_this_program = true; }
void signalHandler(int s __attribute__((unused))) { end_this_program = true; }

void callback_fn(const std::string& button_pin)
{
cout << "--Callback called from button_pin " << button_pin << endl;
++cb;
}

void callback_one(const std::string& button_pin)
void callback_one(const std::string& button_pin __attribute__((unused)))
{
cout << "--First Additional Callback" << endl;
cb1 = true;
}

void callback_two(const std::string& button_pin)
void callback_two(const std::string& button_pin __attribute__((unused)))
{
cout << "--Second Additional Callback" << endl;
cb2 = true;
Expand Down

0 comments on commit 114064b

Please sign in to comment.