Skip to content

Conversation

@fpistm
Copy link
Member

@fpistm fpistm commented Aug 26, 2019

To avoid any issue with F_CPU value, it is defined by default to
SystemCoreClock value which is updated automatically after each
clock configuration update.

Some libraries use F_CPU at build time for conditional purpose (ex to #612).
This commit allow to redefine it at build time using build_opt.h or hal_conf_extra.h:
https://github.com/stm32duino/wiki/wiki/Custom-definitions
then it will be possible to define it as a constant.

Important note:
User have to ensure to set it to the proper value.

To avoid any issue with `F_CPU` value, it is defined by default to
`SystemCoreClock` value which is updated automatically after each
clock configuration update.

Some libraries use `F_CPU` at build time for conditional purpose
(ex to stm32duino#612).
This commit allow to redefine it at build time using `build_opt.h`
or `hal_conf_extra.h`:
https://github.com/stm32duino/wiki/wiki/Custom-definitions
then it will be possible to define it as a constant.

Important note:
**User have to ensure to set it to the proper value.**

Signed-off-by: Frederic.Pillon <[email protected]>
@fpistm fpistm added this to the 1.7.0 milestone Aug 26, 2019
@fpistm fpistm self-assigned this Aug 26, 2019
@fpistm fpistm added arduino compatibility enhancement New feature or request labels Aug 27, 2019
@fpistm fpistm merged commit a107d29 into stm32duino:master Aug 27, 2019
@fpistm fpistm deleted the F_CPU_Redefinition branch August 27, 2019 13:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant