feat(DCU_APP): 添加CPU负载监控和EtherCAT诊断功能
- 在DCU_APP项目中添加cpu_load.h和cpu_load.cpp模块用于CPU负载率监测 - 修改csolution配置将构建目标从Debug切换为Release - 在EtherCAT PDO协议栈中新增段5诊断区(632-639字节),包含负载率和序列号 - 在所有关键中断服务程序中添加CpuLoad::isrEnter()/isrExit()钩子用于准确统计中断占用 - 增强EtherCAT同步中断处理,改进AL事件掩码守护机制,修复OP状态下PDI中断门控问题 - 解决SSC源码中指针地址对齐警告和打包成员访问警告问题 - 在主循环中集成CPU负载率采样tick()调用,实现1秒滚动窗口统计 BREAKING CHANGE: 构建配置从Debug改为Release,EtherCAT协议栈增加新的诊断数据区
This commit is contained in:
@@ -5,6 +5,7 @@
|
||||
|
||||
#include "main.h"
|
||||
#include "sys/initial.h"
|
||||
#include "sys/cpu_load.h"
|
||||
#include "sys/task_manager.h"
|
||||
#include "sys/task_runner.h"
|
||||
#include "sys/config.h"
|
||||
@@ -45,8 +46,15 @@ int App::run()
|
||||
APP_LOGI("[APP] >>> TaskRunner ready, entering main loop\r\n");
|
||||
printBanner();
|
||||
|
||||
CpuLoad::init();
|
||||
|
||||
while(1) {
|
||||
/* 负载率测量(1.5.63 定义收窄):runPending 内部按"非延迟工作"分段挂钩
|
||||
* (ISR 全量 + 任务派发 + 电机 OTA relay,见 sys/cpu_load.h);
|
||||
* 常开轮询(SSC MainLoop / 各 poll)与 NOP 空转不计入。
|
||||
* tick() 每圈无条件做 1s 窗口滚动检查——滚动不依赖本圈是否有挂钩段。 */
|
||||
TaskRunner::runPending();
|
||||
CpuLoad::tick();
|
||||
#if (CONFIG_MAIN_LOOP_WFI_ENABLE != 0)
|
||||
uint32_t save = RT_CRITICAL_SAVE();
|
||||
if(TaskManager::state().task_flags == 0U) {
|
||||
|
||||
Reference in New Issue
Block a user