Skip to content

Commit

Permalink
enable building IRQ-based examples
Browse files Browse the repository at this point in the history
IRQ support is now technically available in all RF24 drivers. This updates the examples' build config accordingly.
  • Loading branch information
2bndy5 committed Jun 17, 2024
1 parent 635e520 commit 2988264
Showing 1 changed file with 7 additions and 21 deletions.
28 changes: 7 additions & 21 deletions examples/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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()

0 comments on commit 2988264

Please sign in to comment.