-
Notifications
You must be signed in to change notification settings - Fork 341
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
P2 h/hal comp scan #301
P2 h/hal comp scan #301
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Big and complex PR for me.
Please start by fixing automated builds...
) | ||
# This function gets a list of hal_driver using a given prefix and suffix | ||
# | ||
# out_list_hal_drivers list of hal_drivers foud |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
# out_list_hal_drivers list of hal_drivers foud | |
# out_list_hal_drivers list of hal_drivers found |
#Keeping only matching files | ||
list(FILTER filtered_files INCLUDE REGEX ${file_pattern}) | ||
#Cleaning files name to have the hal_drivers only (adc/uart/...) | ||
list(TRANSFORM filtered_files REPLACE ${file_pattern} "\\1") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't understand how this line works (even with cmake manual)
foreach(COMP ${HAL_FIND_COMPONENTS}) | ||
string(TOLOWER ${COMP} COMP_L) | ||
string(TOUPPER ${COMP} COMP_U) | ||
string(REGEX MATCH "^STM32([FGHLMUW]P?[0-9BL])([0-9A-Z][0-9M][A-Z][0-9A-Z])?_?(M0PLUS|M4|M7)?.*$" COMP_U ${COMP_U}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1 for #284
foreach(COMP ${HAL_REQUESTED_FAMILIES}) | ||
string(TOLOWER ${COMP} COMP_L) | ||
string(TOUPPER ${COMP} COMP_U) | ||
string(REGEX MATCH "^STM32([FGHLMUW]P?[0-9BL])([0-9A-Z][0-9M][A-Z][0-9A-Z])?_?(M0PLUS|M4|M7)?.*$" COMP_U ${COMP_U}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1 for #284
string(TOUPPER ${COMP} COMP_U) | ||
string(REGEX MATCH "^STM32([FGHLMUW]P?[0-9BL])([0-9A-Z][0-9M][A-Z][0-9A-Z])?_?(M0PLUS|M4|M7)?.*$" COMP_U ${COMP_U}) | ||
if(CMAKE_MATCH_1) | ||
set(FAMILY ${CMAKE_MATCH_1}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unused ?
or supposed to be used in following line instead of COMP_U ?
string(TOLOWER ${COMP} COMP_L) | ||
string(TOUPPER ${COMP} COMP_U) | ||
string(REGEX MATCH "^STM32([FGHLMUW]P?[0-9BL])([0-9A-Z][0-9M][A-Z][0-9A-Z])?_?(M0PLUS|M4|M7)?.*$" COMP_U ${COMP_U}) | ||
if(CMAKE_MATCH_1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please add a comment (example) about what is matched. because https://cmake.org/cmake/help/latest/variable/CMAKE_MATCH_n.html
string(TOLOWER ${COMP} COMP_L) | ||
string(TOUPPER ${COMP} COMP_U) | ||
string(REGEX MATCH "^STM32([FGHLMUW]P?[0-9BL])([0-9A-Z][0-9M][A-Z][0-9A-Z])?_?(M0PLUS|M4|M7)?.*$" COMP_U ${COMP_U}) | ||
if(CMAKE_MATCH_1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please add a comment (example) about what is matched
set(FAMILY ${CMAKE_MATCH_1}) | ||
list(APPEND HAL_FIND_COMPONENTS_FAMILIES ${COMP_U}) | ||
else() | ||
message(FATAL_ERROR "\"${COMP}\" is not a valid FAMILY") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
isn't this already filtered by previous foreach ?
get_list_hal_drivers(HAL_DRIVERS_${FAMILY} ${HAL_${FAMILY}_PATH} "hal") | ||
get_list_hal_drivers(HAL_LL_DRIVERS_${FAMILY} ${HAL_${FAMILY}_PATH} "ll") | ||
list(APPEND HAL_DRIVERS ${HAL_DRIVERS_${FAMILY}}) | ||
list(APPEND HAL_LL_DRIVERS ${HAL_LL_DRIVERS_${FAMILY}}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems _ex
drivers are not managed
string(REGEX MATCH "^STM32([FGHLMUW]P?[0-9BL])([0-9A-Z][0-9M][A-Z][0-9A-Z])?_?(M0PLUS|M4|M7)?.*$" COMP_U ${COMP_U}) | ||
if(CMAKE_MATCH_1) | ||
list(APPEND HAL_FIND_COMPONENTS_FAMILIES ${COMP}) | ||
message(TRACE "FindHAL: append COMP ${COMP} to HAL_FIND_COMPONENTS_FAMILIES") | ||
continue() | ||
endif() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I cant comment in PR bellow this line but please have a look at next occurences of HAL_FIND_COMPONENTS_FAMILIES
it might explain you are breaking the multicore families tests + notice the management of empty list to manage all families. I think your work is not finished
This does a lot of changes, but I did clean commits.
I suggest reviewing commit by commit.
close #268
Closed in favor of #302