fix(firmware/rmcs_board): Configure UART pins with internal pull-up to prevent floating#52
Merged
fix(firmware/rmcs_board): Configure UART pins with internal pull-up to prevent floating#52
Conversation
…o prevent floating
概览该PR为两个板卡配置(lite和pro)的UART初始化添加了PAD_CTL(焊盘控制)设置。移除/替换了包含头文件,并在UART初始化函数中引入了rx_pad和tx_pad常量,配置各个UART实例的接收和发送焊盘的上拉与施密特触发器控制。 变更UART焊盘控制配置
估计审查工作量🎯 3 (Moderate) | ⏱️ ~20 分钟 可能相关的PR
诗意颂
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@firmware/rmcs_board/boards/pro/app/board_app.cpp`:
- Around line 104-127: The DE pin for UART1 (PAD[IOC_PAD_PY05]) is missing a
PAD_CTL assignment: locate the UART1 block where
HPM_IOC->PAD[IOC_PAD_PY05].FUNC_CTL is set (and PIOC_PY05_FUNC_CTL_SOC_GPIO_Y_05
is assigned) and add a corresponding HPM_IOC->PAD[IOC_PAD_PY05].PAD_CTL =
de_pad; define de_pad similarly to tx_pad/rx_pad (e.g., include
IOC_PAD_PAD_CTL_PE_SET and IOC_PAD_PAD_CTL_PS_SET with pull-up or pull-down
chosen to match your RS485 transceiver disable level) so the DE line is biased
during init and won’t float.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: d754c870-8372-4516-b4c8-700e5e6f2e6f
📒 Files selected for processing (2)
firmware/rmcs_board/boards/lite/app/board_app.cppfirmware/rmcs_board/boards/pro/app/board_app.cpp
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
文件变更概览
本 PR 修改了 Lite 和 Pro 两个版本的 UART 初始化代码,主要涉及以下两个文件:
firmware/rmcs_board/boards/lite/app/board_app.cppfirmware/rmcs_board/boards/pro/app/board_app.cpp具体修改内容
两个文件的共同变更:
头文件调整
#include <hpm_common.h>头文件init_uart 函数修改
tx_pad和rx_pad常量定义,这两个常量包含了拉高和施密特触发器配置Lite 版本具体变更:
Pro 版本具体变更:
代码简化效果
这次变更通过移除可配置的拉高和施密特触发器设置,使 UART 初始化函数的代码更加简洁。拉高配置现在可能通过其他方式(如默认硬件配置或 hpm_common.h 中的定义)来处理。