cpu/stm32: Fix ifdefs in periph_gpio_ll#20530
Merged
maribu merged 2 commits intoRIOT-OS:masterfrom Apr 4, 2024
Merged
Conversation
APB12 is never defined as a macro. It is an element in the bus_t enum. Therefore, the test to check if it is defined will always fail. APB12 is not a real bus. It is the second register of the APB1 bus. I am not aware of any STM32 family where the ABP2 bus is implmented (ie RCC_APB2ENR_SYSCFGEN is defined) and devices attached to said bus are enabled via the APB1 second register. For this reason, the fix is to simply remove the check.
This block of code inconsistently made use of else-if statments. The patch makes the use consistent. The change also makes the code a bit simpler to read.
maribu
reviewed
Apr 2, 2024
maribu
approved these changes
Apr 2, 2024
Member
|
Thx for the fix! ❤️ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Contribution description
From the commit msgs:
Testing procedure
I ensured I did not break the build by doing
make -C tests/periph/gpio_ll/ BOARD=nucleo-f767zi. I did not actually run the test, as am not very familiar with the actual driver.Issues/PRs references
none known