feat(cproject): 重构项目文件结构并添加EtherCAT通信支持

- 将设备相关文件重新组织为device/spi和comm分组
- 添加EtherCAT从站通信模块(esc_exmc_bus、esc_lan9252、ethercat_slave等)
- 添加EXMC外设组件支持
- 统一文件命名规范为小写

refactor(canfd): 优化CANFD模块中断安全性和配置方式

- 替换自定义临界区函数为RT_CRITICAL_SAVE/RESTORE宏
- 使用配置常量CONFIG_IRQ_PREEMPT_CAN替代硬编码值
- 简化邮箱满时的处理逻辑,移除不必要的SysTick等待
- 移除废弃的中断保存头文件引用

refactor(timer): 更新定时器配置以使用配置常量

- 修复头文件包含路径大小写问题
- 使用CONFIG_NVIC_PRIORITY_GROUP配置项替代硬编码值
This commit is contained in:
cbb
2026-06-26 00:57:59 +08:00
parent 86c0ec730b
commit 1612e326ee
32 changed files with 1378 additions and 147 deletions
+14 -3
View File
@@ -1,4 +1,4 @@
/**
/**
* @file initial.cpp
* @brief 应用启动初始化实现。
*/
@@ -8,13 +8,18 @@
#include "device/canfd.h"
#include "device/temp_sensor.h"
#include "device/usart0.h"
#include "device/Timer.h"
#include "device/timer.h"
#include "device/adc.h"
#include "device/watchdog.h"
#include "device/app_spi_command.h"
#include "device/spi/app_spi_command.h"
#include "sys/systick.h"
#include "sys/ota_boot_request.h"
#include "sys/task_manager.h"
#include "sys/config.h"
#if CONFIG_ETHERCAT_ENABLE
#include "comm/ethercat_slave.h"
#include "comm/ethercat_sync.h"
#endif
/**
* @brief 执行应用级外设与调度初始化。
@@ -42,6 +47,12 @@ void AppInitializer::init()
TaskManager::init();
printf("[APP] init: SchedulerTimer...\r\n");
SchedulerTimer::init();
#if CONFIG_ETHERCAT_ENABLE
printf("[APP] init: EthercatSlave...\r\n");
EthercatSlave::init();
printf("[APP] init: EthercatSync...\r\n");
EthercatSync::init();
#endif
printf("[APP] init: Watchdog...\r\n");
Watchdog::init();
printf("[APP] init: all done\r\n");