1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2025-01-29 14:52:12 +01:00

Reduce the CPU usage of OSX simuluator

This commit is contained in:
James Cotton 2012-05-08 00:26:22 -05:00
parent cbedb5b53b
commit c723ae3720
2 changed files with 7 additions and 3 deletions

View File

@ -62,6 +62,8 @@
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <time.h>
#include <sys/times.h>
/* Defining MPU_WRAPPERS_INCLUDED_FROM_API_FILE prevents task.h from redefining
all the API functions to use the MPU wrappers. That should only be done when
@ -1943,7 +1945,7 @@ static portTASK_FUNCTION( prvIdleTask, pvParameters )
{
/* Stop warnings. */
( void ) pvParameters;
int last_idle_time = clock();
for( ;; )
{
/* See if any tasks have been deleted. */
@ -1986,6 +1988,8 @@ static portTASK_FUNCTION( prvIdleTask, pvParameters )
without the overhead of a separate task.
NOTE: vApplicationIdleHook() MUST NOT, UNDER ANY CIRCUMSTANCES,
CALL A FUNCTION THAT MIGHT BLOCK. */
while(clock() < (last_idle_time + 1));
last_idle_time = clock();
vApplicationIdleHook();
}
#endif

View File

@ -54,9 +54,9 @@ USE_THUMB_MODE = YES
# List of modules to include
MODULES += Actuator ManualControl Stabilization
MODULES += AltitudeHold Guidance PathPlanner
MODULES += AltitudeHold VtolPathFollower PathPlanner
MODULES += Attitude/revolution
MODULES += OveroSync/simulated
#MODULES += OveroSync/simulated
# To run simulation instead of connect to SITL
MODULES += Sensors/simulated