Conversation
Add Spec and View aliases to host board callback classes to shorten repeated descriptor and data view type names. Use the shorter board callback aliases to rename IMU data view types with explicit IMU prefixes: - AccelerometerDataView -> ImuAccelerometerDataView - GyroscopeDataView -> ImuGyroscopeDataView - TemperatureDataView -> ImuTemperatureDataView Update serializer, deserializer, host callbacks, and firmware callbacks to use the new IMU view names. BREAKING CHANGE: Downstream code that references the old IMU data view names or overrides IMU callbacks must use the new Imu*DataView names.
|
Warning Review limit reached
Next review available in: 36 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
Walkthrough本次改动将 IMU 相关数据视图结构体(加速度计、陀螺仪、温度)重命名为带 Imu 前缀的类型,并在核心序列化/反序列化、固件与主机端各回调接口中同步更新参数类型;同时在主机端多个 Callback 类中新增 Spec/View 嵌套类型别名以统一封装描述符与数据视图类型。 ChangesIMU 数据视图重命名与 Callback 类型分组
Estimated code review effort: 2 (Simple) | ~12 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 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.
🧹 Nitpick comments (1)
host/include/librmcs/board/c_board.hpp (1)
46-53: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win为
gpio_analog_read_result_callback补充View::GpioAnalog别名,并统一 IMU 别名的命名空间限定风格。
View结构体已经为 Can/Uart/GpioDigital 建立别名,但gpio_analog_read_result_callback的数据视图形参仍直接写librmcs::data::GpioAnalogDataView,与本次重构“用 Spec/View 别名收敛重复类型名”的目标不一致。另外,三个 IMU 别名使用了完整限定librmcs::data::Imu*DataView,而其余别名使用短限定data::*DataView,风格不统一。♻️ 建议的重构
struct View { using Can = data::CanDataView; using Uart = data::UartDataView; using GpioDigital = data::GpioDigitalDataView; - using ImuAccelerometer = librmcs::data::ImuAccelerometerDataView; - using ImuGyroscope = librmcs::data::ImuGyroscopeDataView; - using ImuTemperature = librmcs::data::ImuTemperatureDataView; + using GpioAnalog = data::GpioAnalogDataView; + using ImuAccelerometer = data::ImuAccelerometerDataView; + using ImuGyroscope = data::ImuGyroscopeDataView; + using ImuTemperature = data::ImuTemperatureDataView; }; ... virtual void gpio_analog_read_result_callback( - const Spec::Gpio& gpio, const librmcs::data::GpioAnalogDataView& data) { + const Spec::Gpio& gpio, const View::GpioAnalog& data) { (void)gpio; (void)data; }Also applies to: 70-74
🤖 Prompt for 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. In `@host/include/librmcs/board/c_board.hpp` around lines 46 - 53, Summary: add the missing View alias for GpioAnalog and make the IMU alias naming consistent. Update the board::View struct in c_board.hpp to include a GpioAnalog alias alongside Can/Uart/GpioDigital, then adjust gpio_analog_read_result_callback to use that View alias instead of the fully qualified librmcs::data::GpioAnalogDataView. While touching View, normalize the IMU aliases so they follow the same data::*DataView style as the other entries, using the existing View symbols to keep the API consistent.
🤖 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.
Nitpick comments:
In `@host/include/librmcs/board/c_board.hpp`:
- Around line 46-53: Summary: add the missing View alias for GpioAnalog and make
the IMU alias naming consistent. Update the board::View struct in c_board.hpp to
include a GpioAnalog alias alongside Can/Uart/GpioDigital, then adjust
gpio_analog_read_result_callback to use that View alias instead of the fully
qualified librmcs::data::GpioAnalogDataView. While touching View, normalize the
IMU aliases so they follow the same data::*DataView style as the other entries,
using the existing View symbols to keep the API consistent.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 9f01012a-6f60-41ba-bb17-f3040f196d80
📒 Files selected for processing (10)
core/include/librmcs/data/datas.hppcore/src/protocol/deserializer.cppcore/src/protocol/deserializer.hppcore/src/protocol/serializer.hppfirmware/c_board/app/src/usb/vendor.hppfirmware/rmcs_board/app/src/usb/vendor.hpphost/include/librmcs/board/c_board.hpphost/include/librmcs/board/rmcs_board_lite.hpphost/include/librmcs/board/rmcs_board_pro.hpphost/src/protocol/handler.cpp
Add Spec and View aliases to host board callback classes to shorten repeated descriptor and data view type names.
Use the shorter board callback aliases to rename IMU data view types with explicit IMU prefixes:
Update serializer, deserializer, host callbacks, and firmware callbacks to use the new IMU view names.
BREAKING CHANGE: Downstream code that references the old IMU data view names or overrides IMU callbacks must use the new Imu*DataView names.
本次变更重构了 board/协议相关的公开接口,主要包括:
Spec和View两个嵌套别名,减少重复书写 descriptor 和 data view 类型名。AccelerometerDataView→ImuAccelerometerDataViewGyroscopeDataView→ImuGyroscopeDataViewTemperatureDataView→ImuTemperatureDataViewhost/src/protocol/handler.cpp与core/src/protocol/*中对应的 IMU 读写逻辑保持不变,仅类型名更新。这是一个破坏性变更:下游代码若引用旧的 IMU data view 类型或覆盖相关回调,需要切换到新的
Imu*DataView名称。