-
Notifications
You must be signed in to change notification settings - Fork 5.3k
[bsp/nxp/mcx/mcxa] Fix UART clock configuration type mismatch #10797
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
|
👋 感谢您对 RT-Thread 的贡献!Thank you for your contribution to RT-Thread! 为确保代码符合 RT-Thread 的编码规范,请在你的仓库中执行以下步骤运行代码格式化工作流(如果格式化CI运行失败)。 🛠 操作步骤 | Steps
完成后,提交将自动更新至 如有问题欢迎联系我们,再次感谢您的贡献!💐 |
📌 Code Review Assignment🏷️ Tag: bsp_mcxaReviewers: hywing Changed Files (Click to expand)
📊 Current Review Status (Last Updated: 2025-10-13 09:44 CST)
📝 Review Instructions
|
报错好像和libc有关 大佬帮忙看看 |
Fixed implicit type conversion warning in UART driver by correctly separating clock_name_t and clock_attach_id_t enum types. Changes: - Use kCLOCK_Fro12M (clock_name_t) for clock_src field - Keep kFRO12M_to_LPUARTx (clock_attach_id_t) for clock_attach_id field - Fix mcx_getc() to use correct status flag kLPUART_RxDataRegFullFlag This resolves the compiler warning: "implicit conversion from 'int' to 'clock_name_t' changes value from 16777216 to 0" Signed-off-by: Yucai Liu [email protected]
ad1dbd9 to
1899457
Compare
|
@imi415 大佬帮忙看看 |
imi415
left a comment
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.
LGTM. By the way, is this clock_name_t really necessary?
It seems that this can be removed. Currently, all three serial ports are using the same |
|
这个忽略即可,属于误报 |
拉取/合并请求描述:(PR description)
[
Summary
Fixed implicit type conversion warning in NXP MCXA series UART driver by correctly
using the appropriate clock enum types.
Problem
The compiler reported a warning:
implicit conversion from 'int' to 'clock_name_t' changes value from 16777216 to 0
This occurred because the code was using
clock_attach_id_tenum values (likekFRO12M_to_LPUART0) in a field that expectsclock_name_tenum type.Root Cause
The
mcx_uartstructure has two separate clock-related fields with differentpurposes:
clock_src(type:clock_name_t): Used for getting clock frequency viaCLOCK_GetFreq()clock_attach_id(type:clock_attach_id_t): Used for attaching clock source viaCLOCK_AttachClk()The original code incorrectly used
kFRO12M_to_LPUARTx(aclock_attach_id_tvalue)for the
clock_srcfield.Changes Made
kCLOCK_Fro12M(clock_name_t) forall three UARTs
kFRO12M_to_LPUARTx(clock_attach_id_t) forclock routing
kLPUART_RxDataRegFullInterruptEnableto
kLPUART_RxDataRegFullFlagfor correct status checkingTesting
Impact
]
当前拉取/合并请求的状态 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