1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2024-11-29 07:24:13 +01:00

OP-1026 remove legacy idle time calculation in OPLink code

This commit is contained in:
Alessio Morale 2014-02-22 00:31:06 +01:00
parent 3fc3b5b01b
commit 2bcbf7dc86
2 changed files with 5 additions and 16 deletions

View File

@ -63,8 +63,6 @@
// Private types // Private types
// Private variables // Private variables
static uint32_t idleCounter;
static uint32_t idleCounterClear;
static xTaskHandle systemTaskHandle; static xTaskHandle systemTaskHandle;
static bool stackOverflow; static bool stackOverflow;
static bool mallocFailed; static bool mallocFailed;
@ -130,8 +128,6 @@ static void systemTask(__attribute__((unused)) void *parameters)
} }
// Initialize vars // Initialize vars
idleCounter = 0;
idleCounterClear = 0;
lastSysTime = xTaskGetTickCount(); lastSysTime = xTaskGetTickCount();
// Main system loop // Main system loop
@ -205,15 +201,7 @@ static void systemTask(__attribute__((unused)) void *parameters)
* Called by the RTOS when the CPU is idle, used to measure the CPU idle time. * Called by the RTOS when the CPU is idle, used to measure the CPU idle time.
*/ */
void vApplicationIdleHook(void) void vApplicationIdleHook(void)
{ {}
// Called when the scheduler has no tasks to run
if (idleCounterClear == 0) {
++idleCounter;
} else {
idleCounter = 0;
idleCounterClear = 0;
}
}
/** /**
* Called by the RTOS when a stack overflow is detected. * Called by the RTOS when a stack overflow is detected.

View File

@ -75,11 +75,9 @@
#endif #endif
/* Enable run time stats collection */ /* Enable run time stats collection */
#ifdef DIAG_TASKS
#define configCHECK_FOR_STACK_OVERFLOW 2
#define configGENERATE_RUN_TIME_STATS 1 #define configGENERATE_RUN_TIME_STATS 1
#define INCLUDE_uxTaskGetRunTime 1 #define INCLUDE_uxTaskGetRunTime 1
#define INCLUDE_xTaskGetIdleTaskHandle 1
#define portCONFIGURE_TIMER_FOR_RUN_TIME_STATS() \ #define portCONFIGURE_TIMER_FOR_RUN_TIME_STATS() \
do { \ do { \
(*(unsigned long *)0xe000edfc) |= (1 << 24); /* DEMCR |= DEMCR_TRCENA */ \ (*(unsigned long *)0xe000edfc) |= (1 << 24); /* DEMCR |= DEMCR_TRCENA */ \
@ -87,6 +85,9 @@
} \ } \
while (0) while (0)
#define portGET_RUN_TIME_COUNTER_VALUE() (*(unsigned long *)0xe0001004) /* DWT_CYCCNT */ #define portGET_RUN_TIME_COUNTER_VALUE() (*(unsigned long *)0xe0001004) /* DWT_CYCCNT */
#ifdef DIAG_TASKS
#define configCHECK_FOR_STACK_OVERFLOW 2
#else #else
#define configCHECK_FOR_STACK_OVERFLOW 1 #define configCHECK_FOR_STACK_OVERFLOW 1
#endif #endif