mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2024-11-29 07:24:13 +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:
parent
67a05f948e
commit
8cd1a494ab
@ -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. */
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user