[bsp][imxrt1180-nxp-evk]add TIMER support#11511
Conversation
|
👋 感谢您对 RT-Thread 的贡献!Thank you for your contribution to RT-Thread! 为确保代码符合 RT-Thread 的编码规范,请在你的仓库中执行以下步骤运行代码格式化工作流(如果格式化CI运行失败)。 🛠 操作步骤 | Steps
完成后,提交将自动更新至 如有问题欢迎联系我们,再次感谢您的贡献!💐 |
| # CPPDEFINES += ['FSL_SDK_DRIVER_QUICK_ACCESS_ENABLE=1'] | ||
|
|
||
| if GetDepend(['BSP_USING_CLOCK_TIMER']): | ||
| src += ['../packages/nxp-imxrt-sdk-latest/MIMXRT1180/MIMXRT1189/drivers/fsl_gpt.c'] |
|
Hi @Rbb666, |
| if (ret != RT_EOK) | ||
| { | ||
| LOG_E("gpt1 register failed\n"); | ||
| if (err == RT_EOK) |
There was a problem hiding this comment.
没看懂这块代码添加的意义,用 res 返回不就可以了吗?为什么要添加一个 err?
There was a problem hiding this comment.
因为有两个GPT可以初始化,这里如果gpt1初始化失败了,gpt2会继续初始化,但返回gpt1的错误状态。
可供考虑的:
- gpt1失败,gpt2继续初始化,但返回gpt1错误状态【当前方案】
- gpt1初始化失败,不继续初始化gpt2,返回gpt1错误状态 【疑问对应方案】
@Rbb666 建议采用哪一种?
There was a problem hiding this comment.
没修改之前,如果gpt1失败也是可以继续初始化后面的gpt吧,没看到有返回的处理呢?
| #include <rtdevice.h> | ||
|
|
||
| int rt_hw_wdt_init(void); | ||
| int rt_hw_clock_timer_init(void); |
拉取/合并请求描述:(PR description)
[
为什么提交这份PR (why to submit this PR)
add TIMER support
你的解决方案是什么 (what is your solution)
add TIMER support
请提供验证的bsp和config (provide the config and bsp)
]
当前拉取/合并请求的状态 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