-
Notifications
You must be signed in to change notification settings - Fork 5.1k
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
[stm32][drivers][assert] 将STM32 HAL assert与RTT assert接口对接 #4486
Conversation
@@ -111,6 +111,8 @@ path += [cwd + '/config'] | |||
if GetDepend('BSP_USING_ON_CHIP_FLASH'): | |||
path += [cwd + '/drv_flash'] | |||
|
|||
group = DefineGroup('Drivers', src, depend = [''], CPPPATH = path) | |||
CPPDEFINES = ['USE_FULL_ASSERT'] |
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.
这个宏在 stm32xxxx_hal_conf.h
中有定义
/* #define USE_FULL_ASSERT 1U */
这个功能是否启动是不是应该取决于用户是否需要呢?ST 的这种设计,是可以通过 CUBEMX 来开启该功能的。
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.
@Guozhanxin 郭老师看看这个有没有对接的必要 |
直接这么改是不行的,会报警告 我能想到的方案就是,在 scons 脚本里,读一下当前bsp下的cubemx生成的文件,如:https://github.com/RT-Thread/rt-thread/blob/master/bsp/stm32/stm32f407-atk-explorer/board/CubeMX_Config/Inc/stm32f4xx_hal_conf.h 如果里面开启了 USE_FULL_ASSERT,就导出一个全局的宏 STM32_USE_FULL_ASSERT,然后我们就可以在驱动里实现 assert_failed 这个接口了。 |
好麻烦啊 要不就按照海靖说的 让用户自己在cubemx里边√ ?因为当年海靖提出这个问题的时候 #2026 bsp还是标准库,现在已经变成HAL库了 经过海靖提醒之后 我觉得貌似没有太大必要进行对接了。 |
这个问题不是用户打不打勾的问题,而是,他打了勾我们却不知道他打没打勾。。。所以不知道什么时候需要定义 assert_failed 这个函数 |
问题就是,他打了勾,却没有对接这个函数的话,会编译报错。 |
拉取/合并请求描述:(PR description)
[
参见issue:https://github.com//issues/2026
]
以下的内容不应该在提交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):
代码质量 Code Quality:
我在这个拉取/合并请求中已经考虑了 As part of this pull request, I've considered the following:
#if 0
代码,不包含已经被注释了的代码 All redundant code is removed and cleaned up