更新OTA功能,config独立成文件统一定义

refactor(build): 更新项目配置和链接器设置
- 修改GD32C103CB的ROM基地址和大小配置
- 更新系统时钟向量表偏移量设置
- 在cproject.yml中添加BIN输出格式支持
- 增加-O3优化级别和代码移除选项
- 更新csolution版本依赖

feat(device): 优化ADC采样和配置管理
- 将DengFOC依赖替换为FOC模块
- 从config.h引入配置常量
- 重命名FILTER_SIZE为ADC_FILTER_SIZE以提高清晰度
- 优化温度和电流采样滤波实现

refactor(algorithm): 简化FOC控制函数接口
- 为angle_control、velocity_control等函数移除不必要的参数
- 统一函数指针类型定义
- 优化电流计算函数的代码格式
- 调整PID控制器初始化参数
This commit is contained in:
cbb
2026-01-04 22:26:22 +08:00
parent abd64da360
commit d0198fdff7
26 changed files with 716 additions and 439 deletions
+12 -7
View File
@@ -14,6 +14,7 @@ project:
- file: sys/health.cpp
- file: sys/flash.h
- file: sys/flash.cpp
- file: sys/config.h
- group: device
files:
- file: device/Can.cpp
@@ -31,18 +32,20 @@ project:
files:
- file: Algorithm/Filter.cpp
- file: Algorithm/Filter.h
- file: Algorithm/DengFOC.cpp
- file: Algorithm/DengFOC.h
- file: Algorithm/FOC.cpp
- file: Algorithm/FOC.h
- file: Algorithm/pid.cpp
- file: Algorithm/pid.h
components:
- component: ARM::CMSIS:CORE
- component: Device:Startup
- component: Device:EVAL:GD32C10x
- component: Device:GD32C10x_libopt
- component: Device:GD32C10x_StdPeripherals:FMC
- component: Device:GD32C10x_StdPeripherals:ADC
- component: Device:GD32C10x_StdPeripherals:CAN
- component: Device:GD32C10x_StdPeripherals:DMA
- component: Device:GD32C10x_StdPeripherals:EXTI
- component: Device:GD32C10x_StdPeripherals:FMC
- component: Device:GD32C10x_StdPeripherals:GPIO
- component: Device:GD32C10x_StdPeripherals:MISC
- component: Device:GD32C10x_StdPeripherals:PMU
@@ -50,9 +53,7 @@ project:
- component: Device:GD32C10x_StdPeripherals:SPI_I2S
- component: Device:GD32C10x_StdPeripherals:TIMER
- component: Device:GD32C10x_StdPeripherals:USART
- component: Device:GD32C10x_libopt
- component: Device:GD32C10x_StdPeripherals:DBG
- component: Device:EVAL:GD32C10x
- component: Device:GD32C10x_StdPeripherals:FWDGT
- component: Device:GD32C10x_StdPeripherals:WWDGT
- component: Device:GD32C10x_StdPeripherals:BKP
@@ -62,6 +63,7 @@ project:
type:
- elf
- hex
- bin
- map
packs:
- pack: ARM::CMSIS
@@ -73,11 +75,14 @@ project:
- -fshort-wchar
- -D__MICROLIB
- -Wno-register
- -O3 # 添加优化级别
C:
- -D__packed=packed
- -D__packed=__attribute__((packed))
ASM:
- -D__packed=packed
- -D__packed=__attribute__((packed))
- -D__MICROLIB
Link:
- --library_type=microlib
- --entry=Reset_Handler
- --remove # 移除未使用的代码段
- --diag_suppress=L6207,L6210,L6218,L6220,L6222,L6224,L6226,L6228,L6230,L6232,L6234,L6236,L6238,L6240,L6242,L6244,L6246,L6248,L6308,L6329,L6310,L6312,L6314,L6316,L6318,L6320,L6322,L6324,L6326,L6328,L6330,L6332,L6334,L6336,L6338,L6340,L6342,L6344,L6346,L6348,L6350,L6352,L6354,L6311,L6313,L6315,L6317,L6319,L6321,L6323,L6325,L6327,L6329,L6331,L6333,L6335,L6337,L6339,L6341,L6343,L6345,L6347,L6349,L6351,L6353