基于e2studio进行调试模式下能够获取到CPU使用率,复位后不能获取到CPU使用率,请教解决方案

详细描述:

1.当前FSP信息如下;

Device:   R7FA6M5BH3CFP
Toolchain:   GCC ARM Embedded
Toolchain Version:   13.2.1.arm-13-7
FSP Version:   5.4.0
Azure RTOS ThreadX  

2.CPU使用率实现方法:

{/* CPU利用率统计 */

if(++CpuCount >= pdMS_TO_TICKS(200)){//200ms周期计算

deltaIdleTime = _tx_execution_idle_time_total - IdleTime;

deltaTolTime = _tx_execution_thread_time_total + _tx_execution_isr_time_total + _tx_execution_idle_time_total - TolTime;

OsCpuUsage = (f32)((f64)deltaIdleTime/(f64)deltaTolTime);

OsCpuUsage = 100.0f * (1.0f - OsCpuUsage);

Float_to_DHR(OsCpuUsage, &APP.DHR[RW_CpuUsage]);

IdleTime = _tx_execution_idle_time_total;

TolTime = _tx_execution_thread_time_total + _tx_execution_isr_time_total + _tx_execution_idle_time_total;

CpuCount = 0;

}

}

Parents Reply Children
No Data