I am trying to measure the time that the CPU is not in the idle loop. I have the following code in my OS_ISR_Tick handler:
Display All
Then inside of the idle function I have the following:
Display All
When I try to read the values as they are stored in the buffer, most of the time (99.5%) I get the value "1055" which does not seem correct. I have set a probe on a pin and measured to get 57.6 microseconds. Any advice?
C Source Code
Then inside of the idle function I have the following:
C Source Code
- void OS_Idle(void) { // Idle loop: No task is ready to exec
- for (;;)
- {
- if (timeFlag)
- {
- OS_Timing_End(&myT);
- timeFlag = eFALSE;
- timeStruct.timeBuffer[tbIdx++] = OS_Timing_Getus(&myT);
- if (tbIdx > 511)
- tbIdx = 0;
- }
- asm("WAIT"); //enter wait mode
- //four NOP instruction required after WAIT
- asm("NOP");asm("NOP");asm("NOP");asm("NOP"); // Nothing to do ... wait for a interrupt
- }
- }
When I try to read the values as they are stored in the buffer, most of the time (99.5%) I get the value "1055" which does not seem correct. I have set a probe on a pin and measured to get 57.6 microseconds. Any advice?