1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2024-12-01 09:24:10 +01:00

decrease FreeRTOS idle CPU on x86 load from 100 to 0.001 by adding call to nanosleep.

git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@992 ebee16cc-31ac-478f-84a7-5cbb03baadba
This commit is contained in:
corvus 2010-07-03 09:36:01 +00:00 committed by corvus
parent 67a05f948e
commit 8cd1a494ab

View File

@ -53,6 +53,7 @@
#include <stdio.h>
#include <time.h>
#include <stdlib.h>
#include <string.h>
@ -1826,6 +1827,13 @@ static portTASK_FUNCTION( prvIdleTask, pvParameters )
vApplicationIdleHook();
}
#endif
// call nanosleep for smalles sleep time possible
// (depending on kernel settings - around 100 microseconds)
// decreases idle thread CPU load from 100 to practically 0
struct timespec x;
x.tv_sec=0;
x.tv_nsec=0;
nanosleep(&x,NULL);
}
} /*lint !e715 pvParameters is not accessed but all task functions require the same prototype. */