初级会员
- 积分
- 88
- 金钱
- 88
- 注册时间
- 2020-1-22
- 在线时间
- 18 小时
|
#ifdef CPU_CFG_INT_DIS_MEAS_EN
static void CPU_IntDisMeasInit (void)
{
CPU_TS_TMR time_meas_tot_cnts;
CPU_INT16U i;
CPU_SR_ALLOC();
/* ----------- INIT INT DIS TIME MEAS CTRLS ----------- */
CPU_IntDisMeasCtr = 0u;
CPU_IntDisNestCtr = 0u;
CPU_IntDisMeasStart_cnts = 0u;
CPU_IntDisMeasStop_cnts = 0u;
CPU_IntDisMeasMaxCur_cnts = 0u;
CPU_IntDisMeasMax_cnts = 0u;
CPU_IntDisMeasOvrhd_cnts = 0u;
/* ----------- CALC INT DIS TIME MEAS OVRHD ----------- */
time_meas_tot_cnts = 0u;
CPU_INT_DIS(); /* Ints MUST be dis'd for ovrhd calc (see Note #3b). */
for (i = 0u; i < CPU_CFG_INT_DIS_MEAS_OVRHD_NBR; i++) {
CPU_IntDisMeasMaxCur_cnts = 0u;
CPU_IntDisMeasStart(); /* Perform multiple consecutive start/stop time meas's */
CPU_IntDisMeasStop();
time_meas_tot_cnts += CPU_IntDisMeasMaxCur_cnts; /* ... & sum time meas max's ... */
}
/* ... to calc avg time meas ovrhd (see Note #3a). */
CPU_IntDisMeasOvrhd_cnts = (time_meas_tot_cnts + (CPU_CFG_INT_DIS_MEAS_OVRHD_NBR / 2u))
/ CPU_CFG_INT_DIS_MEAS_OVRHD_NBR;
CPU_IntDisMeasMaxCur_cnts = 0u; /* Reset max ints dis'd times. */
CPU_IntDisMeasMax_cnts = 0u;
CPU_INT_EN();
}
#endif
|
|