[fix] components: serial_v2: preserve RT_DEVICE_FLAG_STREAM when reop…#11348
[fix] components: serial_v2: preserve RT_DEVICE_FLAG_STREAM when reop…#11348RCSN wants to merge 1 commit intoRT-Thread:masterfrom
Conversation
…ening serial device - The serial_fops_open function closes and reopens the serial device,but the RT_DEVICE_FLAG_STREAM flag was not preserved across the close/open cycle. This change saves the STREAM flag before close and restores it during reopen to ensure consistent behavior. Signed-off-by: Runcheng Lu <runcheng.lu@hpmicro.com>
|
👋 感谢您对 RT-Thread 的贡献!Thank you for your contribution to RT-Thread! 为确保代码符合 RT-Thread 的编码规范,请在你的仓库中执行以下步骤运行代码格式化工作流(如果格式化CI运行失败)。 🛠 操作步骤 | Steps
完成后,提交将自动更新至 如有问题欢迎联系我们,再次感谢您的贡献!💐 |
📌 Code Review Assignment🏷️ Tag: componentsReviewers: @Maihuanyi Changed Files (Click to expand)
🏷️ Tag: components_driver_serial_v2Reviewers: @Ryan-CW-Code Changed Files (Click to expand)
📊 Current Review Status (Last Updated: 2026-04-28 15:41 CST)
📝 Review Instructions
|
|
lgtm |
并确认并列出已经在什么情况或板卡上进行了测试。
And confirm in which case or board has been tested. -->
HPM6750EVK2
为什么提交这份PR (why to submit this PR)
当使能posix io device时候
msh回车不会移回行首,而是以梯形变化显示,缺少了\r字符
你的解决方案是什么 (what is your solution)
posix使用serail open时候调用serial_fops_open,会先close再open,会导致把flag的RT_DEVICE_FLAG_STREAM覆盖掉,需要先保存flag再close
请提供验证的bsp和config (provide the config and bsp)