-
Notifications
You must be signed in to change notification settings - Fork 3k
STM32: Replace HAL_GetTick #7106
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
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.
I think we can remove much more code with this proposal - what do you think ?
targets/TARGET_STM/hal_tick_32b.c
Outdated
@@ -44,8 +42,6 @@ void timer_irq_handler(void) | |||
__HAL_TIM_CLEAR_IT(&TimMasterHandle, TIM_IT_CC2); |
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 like the idea - great PR !
now if the HAL_GetTick relies on common ticker layer, then I think that the complete code related to the usage of TIM_IT_CC2 can be removed I guess - don't you think ?
This would mean no need to enable/disable CC2 IT, to need to manage the interrupt anymore....
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.
Yes I think you're right. The timer channel2 was here only to generate an interrupt for the HAL tick. I'll make a try.
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 works: I have removed all the code related to timer channel 2 and all mbedOS5 timer tests are PASS. Tested with both 16-bits and 32-bits timers.
@@ -0,0 +1,18 @@ | |||
#include "hal/us_ticker_api.h" |
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.
Can you add a license header on top of this file?
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.
Yep. Forgot it...
/morph build |
Build : SUCCESSBuild number : 2266 Triggering tests/morph test |
Halting CI builds until RC3 PRs are completed. Will resume after. |
/morph test |
Test : SUCCESSBuild number : 2059 |
Exporter Build : SUCCESSBuild number : 1899 |
Description
Tested with a basic code using together HAL_Delay() and _disable_irq functions.
This method has been proposed as a patch by @c1728p9 in PR #6555
Pull request type