-
Notifications
You must be signed in to change notification settings - Fork 335
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
Blinky example minor improvement #225
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.
examples/blinky/CMakeLists.txt
Outdated
find_package(CMSIS COMPONENTS STM32L0 STM32F1 STM32F4 REQUIRED) | ||
find_package(HAL COMPONENTS STM32L0 STM32F1 STM32F4 RCC GPIO CORTEX REQUIRED) | ||
# Find all drivers: | ||
# F4 example enabled by default |
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.
# F4 example enabled by default | |
# Configure here which STM32 target(s) to build | |
# F4 example enabled by default |
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.
Implemented
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.
Using it in #206 seems a good idea. Do you want to merge the two separate folders together again?
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.
@rmspacefish yes please go ahead. This is a clean way to do it.
examples/blinky/CMakeLists.txt
Outdated
|
||
if(L0_EXAMPLE) | ||
find_package(CMSIS COMPONENTS STM32L0 REQUIRED) | ||
find_package(HAL COMPONENTS STM32L0 REQUIRED) |
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 didn't test but shouldn't it be this ?
find_package(HAL COMPONENTS STM32L0 REQUIRED) | |
find_package(HAL COMPONENTS STM32L0 RCC GPIO CORTEX REQUIRED) |
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.
selecting no component will look up all components, so this should work.
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.
But is it what we want ? and it's not same as L4 lines.
If we add a comment it's OK for me
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.
Updated to use find_package
with one call by filling component lists
examples/blinky/CMakeLists.txt
Outdated
find_package(HAL COMPONENTS STM32L0 STM32F1 STM32F4 RCC GPIO CORTEX REQUIRED) | ||
# Find all drivers: | ||
# F4 example enabled by default | ||
option(F4_EXAMPLE "Compile F4 example" ON) |
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's strange to have an option with no effect. Add the required if(F4_EXAMPLE)
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 agree, make it ON by default, but allow to turn it OFF using the adequate if(F4_EXAMPLE)
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.
Updated
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.
Hi!
I love what you have done here 👍
some minor changes :
The scopes are quite large with cmake, so I would use BLINKY_EXAMPLE_F4
kind of name instead of just F4_EXAMPLE
. This will limit possible collisions.
examples/blinky/CMakeLists.txt
Outdated
find_package(HAL COMPONENTS STM32L0 STM32F1 STM32F4 RCC GPIO CORTEX REQUIRED) | ||
# Find all drivers: | ||
# F4 example enabled by default | ||
option(F4_EXAMPLE "Compile F4 example" ON) |
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 agree, make it ON by default, but allow to turn it OFF using the adequate if(F4_EXAMPLE)
I updated
blinky
example to allow choosing the architecture via CMake options, with F4 being the default. I think this is a cleaner solution than commenting out the unneeded code or cloning 3 Cube repositories. What do you think?