Skip to content

[STM32] Sleep code refactor #2192

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

Merged
merged 8 commits into from
Jul 22, 2016
Merged

Conversation

erwango
Copy link
Contributor

@erwango erwango commented Jul 19, 2016

Rework of sleep.c file across all STM32 families.
Aim was to correct sleep bug in DISCO_F469NI, not entering sleep mode due to use of wrong timer.
In the same time I took opportunity to refactor sleep code taking advantage of hal_tick.c functions.

STM32F7xxx code benefits from __INLINE, which is not compiling on other families for ARM and uARM toolchains (not compatible with __weak as per keil documentation).

Erwan GOURIOU added 6 commits July 19, 2016 15:13
In order to enable sleep API factorization, HAL_Suspend/ResumeTick
functions have been implemented in hal_tick.c for each platform.
In order to enable sleep API factorization, HAL_Suspend/ResumeTick
functions have been implemented in hal_tick.c for each platform.
In order to enable sleep API factorization, HAL_Suspend/ResumeTick
functions have been implemented in hal_tick.c for each platform.
In order to enable sleep API factorization, HAL_Suspend/ResumeTick
functions have been implemented in hal_tick.c for each platform.
In order to enable sleep API factorization, HAL_Suspend/ResumeTick
functions have been implemented in hal_tick.c for each platform.
In order to enable sleep API factorization, HAL_Suspend/ResumeTick
functions have been implemented in hal_tick.c for each platform.
@erwango
Copy link
Contributor Author

erwango commented Jul 19, 2016

Build issue due to late rebase.
Pushing a new version soon.

Erwan GOURIOU added 2 commits July 19, 2016 16:36
In order to enable sleep API factorization, HAL_Suspend/ResumeTick
functions have been implemented in hal_tick.c for each platform.
In order to enable sleep API factorization, HAL_Suspend/ResumeTick
functions have been implemented in hal_tick.c for each platform.
@erwango
Copy link
Contributor Author

erwango commented Jul 19, 2016

Non regression results (No regression found vs master status (which has some issues already))
Sleep_Refactor_NonReg.zip

@erwango erwango changed the title Sleep code refactor [STM32] Sleep code refactor Jul 19, 2016
@0xc0170
Copy link
Contributor

0xc0170 commented Jul 21, 2016

Why hal_tick.c is per target and not for a family, for instance hal/targets/cmsis/TARGET_STM/TARGET_STM32F4/TARGET_MTS_DRAGONFLY_F411RE/hal_tick.c is not in hal/targets/cmsis/TARGET_STM/TARGET_STM32F4 ? They look alike from diff here, so might have missed some differences.

Other than that, looks good. +1

@erwango
Copy link
Contributor Author

erwango commented Jul 21, 2016

Why hal_tick.c is per target and not for a family, for instance hal/targets/cmsis/TARGET_STM/TARGET_STM32F4/TARGET_MTS_DRAGONFLY_F411RE/hal_tick.c is not in hal/targets/cmsis/TARGET_STM/TARGET_STM32F4 ? They look alike from diff here, so might have missed some differences.

For now, hal_tick.c contains differences accross boards in some families. For instance, some targets dont have native 32 bit counters, hence we use addtional IT vs 32bit counter enabled boards (NUCLEO_F030R8 for instance).
Though, I agree in other families, this might be even more factorized. But then we'll have different tree structure between families...

@zgoda
Copy link
Contributor

zgoda commented Jul 22, 2016

This is generally related to STM32 and BLUEPILL_F103C8 should be updated accordingly. I can either make fork and PR to this branch or wait for this PR to be merged to upstream master and then fork & PR to mbedmicro/mbed. How do you prefer this to be done?

@0xc0170
Copy link
Contributor

0xc0170 commented Jul 22, 2016

I can either make fork and PR to this branch or wait for this PR to be merged to upstream master and then fork & PR to mbedmicro/mbed. How do you prefer this to be done?

@zgoda Send a separate PR once this one lands. Thanks

@0xc0170
Copy link
Contributor

0xc0170 commented Jul 22, 2016

@mbed-bot: TEST

HOST_OSES=windows
BUILD_TOOLCHAINS=GCC_ARM,ARM,IAR
TARGETS=ALL

@mbed-bot
Copy link

[Build 669]
FAILURE: Something went wrong when building and testing.

@0xc0170
Copy link
Contributor

0xc0170 commented Jul 22, 2016

Test results are fine

@0xc0170 0xc0170 merged commit 6b8ff8f into ARMmbed:master Jul 22, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants