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
+8 -3
View File
@@ -8,6 +8,7 @@
#include "sys/task_manager.h"
#include "sys/task_runner.h"
#include "sys/config.h"
#include "sys/critical.h"
/**
* @brief 打印应用启动横幅与系统时钟信息。
@@ -46,13 +47,17 @@ int App::run()
while(1) {
TaskRunner::runPending();
const uint32_t primask = __get_PRIMASK();
__disable_irq();
#if (CONFIG_MAIN_LOOP_WFI_ENABLE != 0)
uint32_t save = RT_CRITICAL_SAVE();
if(TaskManager::state().task_flags == 0U) {
__DSB();
__WFI();
}
__set_PRIMASK(primask);
RT_CRITICAL_RESTORE(save);
#else
/* EtherCAT 实时模式:关闭 WFI 改用忙等,保证周期中断立即响应。 */
__NOP();
#endif
}
return 0;