Skip to content
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

fix the tick of drv_common.c in stm32 bsp #5126

Closed
wants to merge 3 commits into from
Closed

fix the tick of drv_common.c in stm32 bsp #5126

wants to merge 3 commits into from

Conversation

loogg
Copy link
Contributor

@loogg loogg commented Oct 9, 2021

拉取/合并请求描述:(PR description)

[

  1. 使用 SysTick_CTRL_COUNTFLAG_Msk 位来判断是否在中断或 HAL_GetTick 中调用 HAL_IncTick
  2. SysTick_CTRL_COUNTFLAG_Msk 位读取就被复位,中断和 HAL_GetTick 中判断就形成了互斥
  3. 在中断未开启或在比 SysTick_Handler 优先级更高的中断中调用 HAL库API 中的 HAL_GetTick 返回的 tick 也会走,而不会出现死循环的情况
  4. 配置 systick 使用 SystemCoreClock 变量就好了,不需要不同型号都调不同的 API 获取时钟源
  5. rt_hw_systick_init 放到 HAL_InitTick 中,HAL_InitSystemClock_Config 都会调用它,没必要外部调用了
  6. HAL_SYSTICK_Config 中默认时钟源不分频,没必要 HAL_SYSTICK_CLKSourceConfig(SYSTICK_CLKSOURCE_HCLK),还用宏限制型号
    ]

以下的内容不应该在提交PR时的message修改,修改下述message,PR会被直接关闭。请在提交PR后,浏览器查看PR并对以下检查项逐项check,没问题后逐条在页面上打钩。
The following content must not be changed in the submitted PR message. Otherwise, the PR will be closed immediately. After submitted PR, please use a web browser to visit PR, and check items one by one, and ticked them if no problem.

当前拉取/合并请求的状态 Intent for your PR

必须选择一项 Choose one (Mandatory):

  • 本拉取/合并请求是一个草稿版本 This PR is for a code-review and is intended to get feedback
  • 本拉取/合并请求是一个成熟版本 This PR is mature, and ready to be integrated into the repo

代码质量 Code Quality:

我在这个拉取/合并请求中已经考虑了 As part of this pull request, I've considered the following:

  • 已经仔细查看过代码改动的对比 Already check the difference between PR and old code
  • 代码风格正确,包括缩进空格,命名及其他风格 Style guide is adhered to, including spacing, naming and other styles
  • 没有垃圾代码,代码尽量精简,不包含#if 0代码,不包含已经被注释了的代码 All redundant code is removed and cleaned up
  • 所有变更均有原因及合理的,并且不会影响到其他软件组件代码或BSP All modifications are justified and not affect other components or BSP
  • 对难懂代码均提供对应的注释 I've commented appropriately where code is tricky
  • 本拉取/合并请求代码是高质量的 Code in this PR is of high quality
  • 本拉取/合并使用formatting等源码格式化工具确保格式符合RT-Thread代码规范 This PR complies with RT-Thread code specification

@CLAassistant
Copy link

CLAassistant commented Oct 9, 2021

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
1 out of 2 committers have signed the CLA.

✅ loogg
❌ unknown


unknown seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

@mysterywolf
Copy link
Member

@mysterywolf mysterywolf added BSP: STM32 BSP related with ST/STM32 v4.0.4 labels Oct 9, 2021
@Guozhanxin
Copy link
Member

在中断未开启或在比 SysTick_Handler 优先级更高的中断中调用 HAL库 的 API 中的 HAL_GetTick 返回的 tick 也会走,每调用一次 HAL_GetTick hal tick都会累加,会造成不准,不过感觉问题也不大。

@Guozhanxin Guozhanxin added the +1 Agree +1 label Oct 10, 2021
@BernardXiong
Copy link
Member

两个unknown 用户提交

@mysterywolf
Copy link
Member

可能是龙伟的单位和家里用的不是一个git帐号? 合并的时候别点merge, 用squash吧 压缩成一个commit,merge按钮的旁边有一个下拉按钮,就能看见squash选项了。

@Guozhanxin
Copy link
Member

可能是龙伟的单位和家里用的不是一个git帐号? 合并的时候别点merge, 用squash吧 压缩成一个commit,merge按钮的旁边有一个下拉按钮,就能看见squash选项了。

这个操作并不能解决这个unknwon的问题,还是需要重新提交的

@Guozhanxin Guozhanxin added change req change requestion and removed +1 Agree +1 labels Oct 10, 2021
@mysterywolf
Copy link
Member

mysterywolf commented Oct 10, 2021

这个操作并不能解决这个unknwon的问题,还是需要重新提交的

squash 会把龙伟的头像和unknown头像并在一起,这样就知道是一起提交的了。不用为了个用户名去折腾人家了吧。龙伟单位的电脑git貌似受限。回家提交就是正常的头像。

@loogg
Copy link
Contributor Author

loogg commented Oct 11, 2021

我晚上重新提交下

@mysterywolf
Copy link
Member

ok

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
BSP: STM32 BSP related with ST/STM32 change req change requestion
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants