refactor(modules): 按角色重排 modules/ 目录,消除命名不一致

原 modules/ 下目录大小写混用(BMI088/BUZZER/DR16/IST8310/LED/PID 为大写,
attitude/c_comm/filter/gimbal/ins/motor/referee/shoot 为小写),且把第三方
移植代码(QuaternionEKF/kalman_filter)与本工程封装(ins)混在同一目录。

新结构(全部小写,按角色分层,第三方代码单独隔离):

  modules/
    algorithm/   pid.c/h  filter.c/h          通用算法
    imu/         attitude.c/h  ins.c/h        姿态与惯导封装
    imu/qekf/    QuaternionEKF.c/h  kalman_filter.c/h
                                              (移植自 Wang Hongxi INS 例程)
    sensor/      bmi088.c/h  ist8310.c/h      板载传感器驱动
    comms/       dr16.c/h  c_comm.c/h  referee.c/h
    motor/       dji_motor.c/h                电机抽象
    control/     gimbal.c/h  shoot.c/h        整车控制逻辑
                 (底盘为 chassis.c/h)
    dev/         led.c/h  buzzer.c/h          板级指示/发声

共移动 58 个文件(每板 29 个),旧目录全部删除。

工程文件同步(每个工程各 2 个):
- .uvprojx: Modules 分组 16 个 <FilePath> 改为新路径;
  2 个非空 <IncludePath> 元素:15 个旧模块路径收敛为 8 个新目录,
  并顺带删除陈旧项 ../modules/AHRS(目录根本不存在,legacy 时代残留)
  与冗余项 ..\bsp(与 ../Bsp/Inc 重复)
- .uvoptx: 16 个 <PathWithFileName> 同步

关于"为什么不用改源码": Keil 的 include 靠 IncludePath 解析,本工程所有
#include 都是纯文件名形式(无路径限定),所以移动目录只需改工程配置。
另外 .h 完全不登记在工程里(只有 16 个 .c 被登记),故头文件只需移动。

回归验证(无法在此环境编译,用等价判据):
- 两个工程引用的 98 / 95 个 <FilePath> 全部真实存在
- 磁盘上 47 / 45 个 .c 全部仍被工程引用 —— 即没有任何文件掉出编译
- 2 个 IncludePath 元素均含全部 8 个新模块目录,无旧路径残留
- 所有 IncludePath 指向的目录均真实存在
- .uvprojx/.uvoptx XML 良构
- 两棵树结构一致(chassis/gimbal 等板级差异符合预期)

⚠️ 仍需在 Keil 里点一次编译确认(见 README 的构建章节)。
This commit is contained in:
2026-09-12 11:51:41 +08:00
parent 3e5e5e3f95
commit e3d432f3b5
62 changed files with 62 additions and 62 deletions
+14 -14
View File
@@ -1186,7 +1186,7 @@
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<bDave2>0</bDave2>
<PathWithFileName>..\modules\PID\pid.c</PathWithFileName>
<PathWithFileName>..\modules\algorithm\pid.c</PathWithFileName>
<FilenameWithoutPath>pid.c</FilenameWithoutPath>
<RteFlg>0</RteFlg>
<bShared>0</bShared>
@@ -1198,7 +1198,7 @@
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<bDave2>0</bDave2>
<PathWithFileName>..\modules\filter\filter.c</PathWithFileName>
<PathWithFileName>..\modules\algorithm\filter.c</PathWithFileName>
<FilenameWithoutPath>filter.c</FilenameWithoutPath>
<RteFlg>0</RteFlg>
<bShared>0</bShared>
@@ -1222,7 +1222,7 @@
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<bDave2>0</bDave2>
<PathWithFileName>..\modules\DR16\dr16.c</PathWithFileName>
<PathWithFileName>..\modules\comms\dr16.c</PathWithFileName>
<FilenameWithoutPath>dr16.c</FilenameWithoutPath>
<RteFlg>0</RteFlg>
<bShared>0</bShared>
@@ -1234,7 +1234,7 @@
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<bDave2>0</bDave2>
<PathWithFileName>..\modules\referee\referee.c</PathWithFileName>
<PathWithFileName>..\modules\comms\referee.c</PathWithFileName>
<FilenameWithoutPath>referee.c</FilenameWithoutPath>
<RteFlg>0</RteFlg>
<bShared>0</bShared>
@@ -1246,7 +1246,7 @@
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<bDave2>0</bDave2>
<PathWithFileName>..\modules\LED\led.c</PathWithFileName>
<PathWithFileName>..\modules\dev\led.c</PathWithFileName>
<FilenameWithoutPath>led.c</FilenameWithoutPath>
<RteFlg>0</RteFlg>
<bShared>0</bShared>
@@ -1258,7 +1258,7 @@
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<bDave2>0</bDave2>
<PathWithFileName>..\modules\BUZZER\buzzer.c</PathWithFileName>
<PathWithFileName>..\modules\dev\buzzer.c</PathWithFileName>
<FilenameWithoutPath>buzzer.c</FilenameWithoutPath>
<RteFlg>0</RteFlg>
<bShared>0</bShared>
@@ -1270,7 +1270,7 @@
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<bDave2>0</bDave2>
<PathWithFileName>..\modules\c_comm\c_comm.c</PathWithFileName>
<PathWithFileName>..\modules\comms\c_comm.c</PathWithFileName>
<FilenameWithoutPath>c_comm.c</FilenameWithoutPath>
<RteFlg>0</RteFlg>
<bShared>0</bShared>
@@ -1282,7 +1282,7 @@
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<bDave2>0</bDave2>
<PathWithFileName>..\modules\chassis\chassis.c</PathWithFileName>
<PathWithFileName>..\modules\control\chassis.c</PathWithFileName>
<FilenameWithoutPath>chassis.c</FilenameWithoutPath>
<RteFlg>0</RteFlg>
<bShared>0</bShared>
@@ -1294,7 +1294,7 @@
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<bDave2>0</bDave2>
<PathWithFileName>..\modules\BMI088\bmi088.c</PathWithFileName>
<PathWithFileName>..\modules\sensor\bmi088.c</PathWithFileName>
<FilenameWithoutPath>bmi088.c</FilenameWithoutPath>
<RteFlg>0</RteFlg>
<bShared>0</bShared>
@@ -1306,7 +1306,7 @@
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<bDave2>0</bDave2>
<PathWithFileName>..\modules\IST8310\ist8310.c</PathWithFileName>
<PathWithFileName>..\modules\sensor\ist8310.c</PathWithFileName>
<FilenameWithoutPath>ist8310.c</FilenameWithoutPath>
<RteFlg>0</RteFlg>
<bShared>0</bShared>
@@ -1318,7 +1318,7 @@
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<bDave2>0</bDave2>
<PathWithFileName>..\modules\attitude\attitude.c</PathWithFileName>
<PathWithFileName>..\modules\imu\attitude.c</PathWithFileName>
<FilenameWithoutPath>attitude.c</FilenameWithoutPath>
<RteFlg>0</RteFlg>
<bShared>0</bShared>
@@ -1330,7 +1330,7 @@
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<bDave2>0</bDave2>
<PathWithFileName>..\modules\ins\kalman_filter.c</PathWithFileName>
<PathWithFileName>..\modules\imu\qekf\kalman_filter.c</PathWithFileName>
<FilenameWithoutPath>kalman_filter.c</FilenameWithoutPath>
<RteFlg>0</RteFlg>
<bShared>0</bShared>
@@ -1342,7 +1342,7 @@
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<bDave2>0</bDave2>
<PathWithFileName>..\modules\ins\QuaternionEKF.c</PathWithFileName>
<PathWithFileName>..\modules\imu\qekf\QuaternionEKF.c</PathWithFileName>
<FilenameWithoutPath>QuaternionEKF.c</FilenameWithoutPath>
<RteFlg>0</RteFlg>
<bShared>0</bShared>
@@ -1354,7 +1354,7 @@
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<bDave2>0</bDave2>
<PathWithFileName>..\modules\ins\ins.c</PathWithFileName>
<PathWithFileName>..\modules\imu\ins.c</PathWithFileName>
<FilenameWithoutPath>ins.c</FilenameWithoutPath>
<RteFlg>0</RteFlg>
<bShared>0</bShared>