cpu/gd32v: move board dependent RTT configs to board config #19211
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
This PR fixes the problem that the RTT frequency is defined to be 40.0 kHz instead of 32.768 kHz if
TEST_KCONFIG=1
is not defined.The problem was caused by the order in which the headers were included. In
cpu/gd32v/include/periph_cpu.h
the RTT frequency was defined to be 32.768 kHz or 40.0 kHz, depending on theCONFIG_BOARD_HAS_LXTAL
configuration of the board. IfTEST_KCONFIG=1
is used, it is defined inautoconfig.h
and is always known, but withoutTEST_KCONFIG=1
it is defined in theperiph_conf.h
of the board. Ifperiph_cpu.h
is included but notperiph_conf.h
,CONFIG_BOARD_HAS_LXTAL
is not defined withoutTEST_KCONFIG=1
and the RTT frequency is defined to be 40.0 kHz.The solution is to move board dependent RTT configurations to
periph_common.conf
.Testing procedure
should still work.
Issues/PRs references