From 2988264ec4e576720c3af8845cd3f418f1bc21a7 Mon Sep 17 00:00:00 2001 From: Brendan <2bndy5@gmail.com> Date: Mon, 17 Jun 2024 15:29:17 -0700 Subject: [PATCH] enable building IRQ-based examples IRQ support is now technically available in all RF24 drivers. This updates the examples' build config accordingly. --- examples/CMakeLists.txt | 28 +++++++--------------------- 1 file changed, 7 insertions(+), 21 deletions(-) diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt index daacb69..0a19467 100644 --- a/examples/CMakeLists.txt +++ b/examples/CMakeLists.txt @@ -44,15 +44,13 @@ elseif("${RF24_DRIVER}" STREQUAL "wiringPi") else() message(FATAL "Lib ${RF24_DRIVER} not found.") endif() -elseif(NOT "${LibPIGPIO}" STREQUAL "LibPIGPIO-NOTFOUND" AND NOT DEFINED RF24_NO_INTERRUPT) - if(NOT "${RF24_DRIVER}" STREQUAL "pigpio") - message(STATUS "linking to ${LibPIGPIO} for interrupt support") - else() +elseif(NOT "${RF24_DRIVER}" STREQUAL "pigpio") + if(NOT "${LibPIGPIO}" STREQUAL "LibPIGPIO-NOTFOUND") message(STATUS "linking to ${LibPIGPIO}") + list(APPEND linked_libs ${LibPIGPIO}) + else() + message(FATAL "lib ${RF24_DRIVER} not found.") endif() - list(APPEND linked_libs ${LibPIGPIO}) -else() - message(STATUS "Disabling IRQ pin support") endif() set(example RF24GatewayNode) @@ -63,24 +61,12 @@ add_executable(${example} ${example}.cpp) target_link_libraries(${example} PUBLIC ${linked_libs} ) -if("${LibPIGPIO}" STREQUAL "LibPIGPIO-NOTFOUND" OR DEFINED RF24_NO_INTERRUPT) - target_compile_definitions(${example} PUBLIC RF24_NO_INTERRUPT) -endif() - -if("${RF24_DRIVER}" STREQUAL "MRAA" OR "${RF24_DRIVER}" STREQUAL "wiringPi") - message(STATUS "skipping gwNodeInt example because it is incompatible with selected driver") -elseif(NOT "${LibPIGPIO}" STREQUAL "LibPIGPIO-NOTFOUND" AND NOT DEFINED RF24_NO_INTERRUPT) - add_subdirectory(gwNodeInt) -endif() +add_subdirectory(gwNodeInt) add_subdirectory(addons/Sniffer) include(../cmake/enableNcursesExample.cmake) if(BUILD_NCURSES_EXAMPLE) add_subdirectory(ncurses) - if("${RF24_DRIVER}" STREQUAL "MRAA" OR "${RF24_DRIVER}" STREQUAL "wiringPi") - message(STATUS "skipping ncursesInt example because it is incompatible with selected driver") - elseif(NOT "${LibPIGPIO}" STREQUAL "LibPIGPIO-NOTFOUND" AND NOT DEFINED RF24_NO_INTERRUPT) - add_subdirectory(ncursesInt) - endif() + add_subdirectory(ncursesInt) endif()