Repository navigation
WT102 陀螺仪按 ICBSP 约定适配 - #2
Merged
Merged
Conversation
- 移到 code/device/sensor/device_wt102.hpp;包含路径改成相对 code/(bsp/…、service/system/…), 修好合并 phase2 后 GLOB_RECURSE 收进来却找不到头文件的编译失败 - 模板只有头文件(编码规范 4.3):实现并进 .hpp,删掉 .cpp 与三种 BspUartT 组合的显式实例化,任意组合都能用 - EventState 默认树(Q6):init() 挂到所用串口的总线节点,帧格式不对记 init_error; update() 发现由在线变离线记 TIMEOUT;新增 get_state() - 查询接口按 get_ 前缀改名:z_newest() → get_z_newest()、z_previous() → get_z_previous() - tools/manifest.json 登记 wt102(compile_only);device.md、代码层索引、实测状态表、README、接入指南同步 验证:check_layers OK;tools/tests 42 项通过;DM-MC02 宿主 -Wall -Wextra -Werror 下 -O0 / -O2 显式实例化 dma / it 两种串口通过,宿主整体编译链接 0 warning。未上板。 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
概述
eff9f5e加的 WT102 陀螺仪驱动是按旧目录和旧规则写的。PR #1(phase2)合入后,main编译会失败:CMakeLists.txt用GLOB_RECURSE收集源文件,会把code/device/device_wt102.cpp收进来code/,#include "bsp_uart.hpp"这类写法找不到头文件本 PR 把 WT102 按 phase2 的约定适配,修好
main的编译。改动
code/device/sensor/device_wt102.hpp,包含改为bsp/…、service/system/….hpp,删掉.cpp和三种BspUartT组合的显式实例化,任意串口组合都能用DeviceR9dsT一致):init()挂到所用串口的总线节点,帧格式不对记init_error;update()发现由在线变离线记TIMEOUT;新增get_state()get_前缀):z_newest()→get_z_newest()、z_previous()→get_z_previous()tools/manifest.json新增wt102(compile_only),可由integrate.py/ Web UI 生成实例;device.md、代码层索引、实测状态表、README、接入指南同步协议解析逻辑(找帧头、校验和、三种帧型的取值位置)没有改动。
测试
python3 tools/check_layers.py:OKtools/tests:42 项通过-Wall -Wextra -Werror,-O0/-O2显式实例化 dma / it 两种串口:通过get_diag()计数正常、get_z_newest()有数、拔线后默认树记TIMEOUTapp/compile_probe.cpp加一行DeviceWt102T实例化(编码规范 4.3)🤖 Generated with Claude Code