refactor: 哨兵分支整理目录结构,按功能归类(只搬家,程序不变)
基于战队 main 9de485e。两块板统一改为三层目录,Keil 工程分组与文件夹一一对应:
- App/ 本板业务,按功能分文件夹(system/ cmd/ comm/ referee/,
云台另有 gimbal/ shoot/ vision/,底盘另有 chassis/,含 hlj_pc、supercap)
- Lib/ 与业务无关的通用模块(algorithm/ motor/ imu/ sensor/ dev/),两板逐字节相同
- Bsp/ bsp_can、bsp_usart,不再分 Inc/Src
具体改动:
- 107 个文件全部 git mv(纯重命名,内容不变),文件名不变,#include 不用改
- .uvprojx:Application/Task、Modules、BSP 三个分组换成新分组,登记文件集合不变;
头文件路径换成新目录,CubeMX/第三方目录不动
- .uvoptx 分组同步,文件序号重新连续编号
- 根 README 和两块板 README 的路径、代码地图、模块清单同步更新(补 hlj_pc、supercap)
- 新增 doc/目录整理说明.md(新旧路径对照、验证方法、以后如何跟进步兵更新)
验证(整理前后同一编译器):
- 两块板 Program Size 完全相同
底盘 Code=111184 RO=1956 RW=432 ZI=62720
云台 Code=109876 RO=1960 RW=420 ZI=62764
- .map 符号表(名字/类型/大小/所在 .o)底盘 1155 个、云台 1156 个,逐条一致
未改动:Core/、Drivers/、Middlewares/、USB_DEVICE/、CubeMX 分组名与任务名、module_test/
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
9de485e4ef
commit
4b75e4ec6e
115 files changed
+1200
-818
No files matched your search
@@ -0,0 +1,54 @@
|
||||
/*
|
||||
*文件名称:shoot_task.c
|
||||
*功能描述:发射机构控制任务(2ms),计算摩擦轮与拨弹电流并发送0x200控制帧
|
||||
*备注:发射机构上电状态来自底盘0x019(ctoc_shooter_power)
|
||||
*/
|
||||
#include "app_tasks.h"
|
||||
#include "cmsis_os.h"
|
||||
#include "FreeRTOS.h"
|
||||
#include "task.h"
|
||||
#include "robot_typedef.h"
|
||||
#include "gimbal.h"
|
||||
#include "shoot.h"
|
||||
#include "c_comm.h"
|
||||
#include "dr16.h"
|
||||
#include "robot_param.h"//GIMBAL_BENCH_RAMMER_TUNE等开关定义
|
||||
|
||||
/*
|
||||
*函数简介:发射机构控制任务(2ms)
|
||||
*参数说明:argument:FreeRTOS任务参数(未使用)
|
||||
*返回类型:无
|
||||
*备注:支持台架单机拨弹调试模式与整车门控模式
|
||||
*/
|
||||
void shoot_task(void const * argument)
|
||||
{
|
||||
(void)argument;
|
||||
|
||||
TickType_t last_wake = xTaskGetTickCount();//绝对延时基准
|
||||
|
||||
while (!app_ready)
|
||||
osDelay(2);
|
||||
|
||||
for (;;)
|
||||
{
|
||||
#if GIMBAL_BENCH_RAMMER_TUNE
|
||||
/* 台架调试工况:仅M2006+DT7单机拨弹,旁路整车门控 */
|
||||
shoot_bench_step();
|
||||
shoot_bench_send();
|
||||
#else
|
||||
if (cmd_robot.online && !gimbal_motor_offline() && !ctoc_chassis_fault())
|
||||
{
|
||||
shoot_control(cmd_robot.friction_on, cmd_robot.fire, cmd_robot.eject,
|
||||
ctoc_shooter_power);
|
||||
shoot_send_cmd();
|
||||
}
|
||||
else
|
||||
{
|
||||
shoot_output_zero();
|
||||
}
|
||||
#endif
|
||||
|
||||
monitor_heartbeat(HB_SHOOT);
|
||||
vTaskDelayUntil(&last_wake, pdMS_TO_TICKS(2));
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user