Subversion Repositories HomeAutomation

Rev

Rev 2238 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | SVN | RSS feed

Rev 2238 Rev 2242
Line 23... Line 23...
23
#endif
23
#endif
24
 
24
 
25
#if tst_Benchmark_CpuTime_TestActive == 1
25
#if tst_Benchmark_CpuTime_TestActive == 1
26
uint16_t tst_Benchmark_CpuTime_Min = 0xffff;
26
uint16_t tst_Benchmark_CpuTime_Min = 0xffff;
27
uint16_t tst_Benchmark_CpuTime_Max = 0x0000;
27
uint16_t tst_Benchmark_CpuTime_Max = 0x0000;
28
uint16_t tst_Benchmark_CpuTime_Avg = 0x0000;
28
uint32_t tst_Benchmark_CpuTime_Avg = 0x0000;
29
uint16_t tst_Benchmark_CpuTime_Avg_Cnt = 0;
29
//uint16_t tst_Benchmark_CpuTime_Avg_Cnt = 0;
30
StdCan_Msg_t tst_Benchmark_CpuTime_txMsg;
30
StdCan_Msg_t tst_Benchmark_CpuTime_txMsg;
31
uint16_t tst_Benchmark_CpuTime_timer_val;
31
uint16_t tst_Benchmark_CpuTime_timer_val;
32
#endif
32
#endif
33
 
33
 
34
 
34
 
Line 115... Line 115...
115
    if (tst_Benchmark_CpuTime_Max < timeSpent)
115
    if (tst_Benchmark_CpuTime_Max < timeSpent)
116
    {
116
    {
117
        tst_Benchmark_CpuTime_Max = timeSpent;
117
        tst_Benchmark_CpuTime_Max = timeSpent;
118
    }
118
    }
119
   
119
   
120
    uint32_t sum = tst_Benchmark_CpuTime_Avg * tst_Benchmark_CpuTime_Avg_Cnt + timeSpent;
120
    uint64_t sum = tst_Benchmark_CpuTime_Avg * 127 + (timeSpent<<8);
121
    if (tst_Benchmark_CpuTime_Avg_Cnt < 0xffff)
-
 
122
    {
-
 
123
        tst_Benchmark_CpuTime_Avg_Cnt++;
121
    tst_Benchmark_CpuTime_Avg = sum / 128;
124
    }
-
 
125
    tst_Benchmark_CpuTime_Avg = sum / tst_Benchmark_CpuTime_Avg_Cnt;
-
 
126
 
122
 
127
    if (Timer_Expired(tst_Benchmark_CpuTime_SEND_TIMER))
123
    if (Timer_Expired(tst_Benchmark_CpuTime_SEND_TIMER))
128
    {
124
    {
129
        tst_Benchmark_CpuTime_txMsg.Data[0] = 0; // Write test number?
125
        tst_Benchmark_CpuTime_txMsg.Data[0] = 0; // Write test number?
130
        tst_Benchmark_CpuTime_txMsg.Data[1] = 0;
126
        tst_Benchmark_CpuTime_txMsg.Data[1] = 0;
131
        tst_Benchmark_CpuTime_txMsg.Data[2] = (tst_Benchmark_CpuTime_Avg>>8)&0xff;
127
        tst_Benchmark_CpuTime_txMsg.Data[2] = (tst_Benchmark_CpuTime_Avg>>16)&0xff;
132
        tst_Benchmark_CpuTime_txMsg.Data[3] = tst_Benchmark_CpuTime_Avg&0xff;
128
        tst_Benchmark_CpuTime_txMsg.Data[3] = (tst_Benchmark_CpuTime_Avg>>8)&0xff;
133
        tst_Benchmark_CpuTime_txMsg.Data[4] = (tst_Benchmark_CpuTime_Min>>8)&0xff;
129
        tst_Benchmark_CpuTime_txMsg.Data[4] = (tst_Benchmark_CpuTime_Min>>8)&0xff;
134
        tst_Benchmark_CpuTime_txMsg.Data[5] = tst_Benchmark_CpuTime_Min&0xff;
130
        tst_Benchmark_CpuTime_txMsg.Data[5] = tst_Benchmark_CpuTime_Min&0xff;
135
        tst_Benchmark_CpuTime_txMsg.Data[6] = (tst_Benchmark_CpuTime_Max>>8)&0xff;
131
        tst_Benchmark_CpuTime_txMsg.Data[6] = (tst_Benchmark_CpuTime_Max>>8)&0xff;
136
        tst_Benchmark_CpuTime_txMsg.Data[7] = tst_Benchmark_CpuTime_Max&0xff;
132
        tst_Benchmark_CpuTime_txMsg.Data[7] = tst_Benchmark_CpuTime_Max&0xff;
137
 
133