集中所有外设初始化于main函数起始处,通过返回值确认各模块是否成功启动; refactor(adc): 修改采样器初始化返回值 将sampler构造函数替换为带返回值的init方法,在main函数中加入初始化结果判断, 确保系统启动时硬件配置正确加载。 feat(motor): 引入motor模块并重构电机控制逻辑 将GPIO操作封装进motor_sleep和motor_resume函数,提升代码可读性和维护性。 引入motor.h头文件,并在main.cpp中进行电机初始化统一管理。 修改FOC控制器中的shutdown与resume方法调用新接口。 refactor(filter): 优化卡尔曼滤波器实现 重命名状态变量xp为x,简化访问逻辑;移除冗余注释及未使用的getlastAngle方法; 调整getVelocity计算系数,提高速度估算精度;增加init方法支持初始状态设置。 refactor(angle_sensor): 移除冗余速度计算功能 删除传感器内部的速度估算相关数组和方法,交由外部滤波器处理以降低耦合度。 更新SPI片选宏定义以区分不同设备,并增强错误处理机制。 refactor(can): 调整CAN通信ID及初始化流程 更改状态与配置帧的标识符ID,添加对特定命令ID的响应处理如电机复位指令。 将CAN_transmiter构造函数改为init方法,配合主程序完成模块化初始化检查。
79 lines
2.3 KiB
YAML
79 lines
2.3 KiB
YAML
project:
|
|
groups:
|
|
- group: Source Files
|
|
files:
|
|
- file: main.h
|
|
- file: main.cpp
|
|
- group: sys
|
|
files:
|
|
- file: sys/systick.cpp
|
|
- file: sys/systick.h
|
|
- file: sys/initial.cpp
|
|
- file: sys/initial.h
|
|
- file: sys/health.h
|
|
- file: sys/health.cpp
|
|
- group: device
|
|
files:
|
|
- file: device/Can.cpp
|
|
- file: device/Can.h
|
|
- file: device/ang_sensor.cpp
|
|
- file: device/ang_sensor.h
|
|
- file: device/ADC.cpp
|
|
- file: device/adc.h
|
|
- file: device/Timer.cpp
|
|
- file: device/Timer.h
|
|
- file: device/test.cpp
|
|
- file: device/motor.cpp
|
|
- file: device/motor.h
|
|
- group: Algorithm
|
|
files:
|
|
- file: Algorithm/Filter.cpp
|
|
- file: Algorithm/Filter.h
|
|
- file: Algorithm/DengFOC.cpp
|
|
- file: Algorithm/DengFOC.h
|
|
- file: Algorithm/pid.cpp
|
|
- file: pid.h
|
|
components:
|
|
- component: ARM::CMSIS:CORE
|
|
- component: Device:Startup
|
|
- 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
|
|
- component: Device:GD32C10x_StdPeripherals:RCU
|
|
- 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
|
|
output:
|
|
type:
|
|
- elf
|
|
- hex
|
|
- map
|
|
packs:
|
|
- pack: ARM::CMSIS
|
|
- pack: GigaDevice::GD32C10x_DFP
|
|
misc:
|
|
- for-compiler: AC6
|
|
C-CPP:
|
|
- -fshort-enums
|
|
- -fshort-wchar
|
|
- -D__MICROLIB
|
|
- -Wno-register
|
|
C:
|
|
- -D__packed=packed
|
|
ASM:
|
|
- -D__packed=packed
|
|
- -D__MICROLIB
|
|
Link:
|
|
- --library_type=microlib
|
|
- --entry=Reset_Handler
|