Updated Rpi4 revision list, improved readability of code (#10)

Co-authored-by: Stefan Sherwood <miraculum1@gmail.com>
This commit is contained in:
stefan-sherwood 2020-07-20 18:25:24 -04:00 committed by GitHub
parent c3f9c29ce7
commit 310b346b3c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 3 deletions

View File

@ -60,10 +60,11 @@ if(GST_BUILD)
add_definitions(-DRPI)
include(${CMAKE_CURRENT_SOURCE_DIR}/cmake_modules/functions.cmake)
findRpiRevision( RPI_REVISION )
if(RPI_REVISION MATCHES "a03111" OR RPI_REVISION MATCHES "b03111" OR RPI_REVISION MATCHES "a03111")
set(RPI_4_REVISIONS a03111 b03111 b03112 c03111 c03112 d03114)
if(RPI_REVISION IN_LIST RPI_4_REVISIONS)
message("Raspberry Pi 4 Found")
add_definitions(-DPI4)
endif(RPI_REVISION MATCHES "a03111" OR RPI_REVISION MATCHES "b03111" OR RPI_REVISION MATCHES "a03111")
endif(RPI_REVISION IN_LIST RPI_4_REVISIONS)
endif(RPI_BUILD)
message(STATUS "${GST_LIBRARIES}")
endif(GST_BUILD)

View File

@ -1,7 +1,7 @@
function( findRpiRevision OUTPUT )
# Find it with an automated script
execute_process( COMMAND grep -Po "^Revision\\s*:\\s*\\K[[:xdigit:]]+" /proc/cpuinfo OUTPUT_VARIABLE TMP )
execute_process( COMMAND grep -Po "^Revision\\s*:\\s*\\K[[:xdigit:]]+" /proc/cpuinfo OUTPUT_VARIABLE TMP OUTPUT_STRIP_TRAILING_WHITESPACE )
# If have not found the Revision number, use the last version
if ( TMP )