Conversation
Signed-off-by: GuEe-GUI <2991707448@qq.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)
📊 Current Review Status (Last Updated: 2025-12-03 17:53 CST)
📝 Review Instructions
|
There was a problem hiding this comment.
Pull request overview
This PR updates the LED driver subsystem with bug fixes and adds two new LED driver implementations (PWM and Syscon). The changes address a critical string comparison bug and introduce a heartbeat blink pattern, while also improving memory allocation practices.
Key Changes:
- Fixed critical bug: corrected
rt_strncpytort_strncmpfor LED state matching - Added heartbeat-style LED blink pattern with configurable timing
- Introduced PWM-based LED driver with brightness control support
- Introduced Syscon (system controller) LED driver for register-bit controlled LEDs
- Improved memory allocation in GPIO LED driver using
rt_callocfor zero-initialization
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 10 comments.
Show a summary per file
| File | Description |
|---|---|
| components/drivers/led/led.c | Fixed string comparison bug, added heartbeat blink pattern with timing control and count tracking |
| components/drivers/led/led-gpio.c | Changed allocation from rt_malloc to rt_calloc for proper zero-initialization |
| components/drivers/led/led-pwm.c | New PWM LED driver with brightness control, device tree support, and heartbeat trigger |
| components/drivers/led/led-syscon.c | New Syscon LED driver for register-bit controlled LEDs with device tree support |
| components/drivers/led/SConscript | Added build configuration for new PWM and Syscon LED drivers |
| components/drivers/led/Kconfig | Added configuration options for RT_LED_PWM and RT_LED_SYSCON |
Signed-off-by: GuEe-GUI <2991707448@qq.com>
Signed-off-by: GuEe-GUI <2991707448@qq.com>
1. PWM-LED 2. Syscon-LED Signed-off-by: GuEe-GUI <2991707448@qq.com>
|
@Rbb666 AI 要求问题已修改 |
拉取/合并请求描述:(PR description)
[
]
当前拉取/合并请求的状态 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