mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-15 14:33:34 +08:00
Work in progress to support a speed factor in SITL
These contains some rough changes trying to get SITL to speed up by a SPEED_FACTOR. This platform time code probably requires some more thought and refactor but this gets a demo at 4x working.
This commit is contained in:
@@ -73,6 +73,12 @@
|
||||
#define system_sleep sleep
|
||||
#pragma GCC poison sleep
|
||||
|
||||
#include <pthread.h>
|
||||
#define system_pthread_cond_timedwait pthread_cond_timedwait
|
||||
// We can't poison pthread_cond_timedwait because it seems to be used in the
|
||||
// <string> include.
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
#include <cstdlib>
|
||||
#endif
|
||||
|
||||
+1
-1
Submodule src/lib/DriverFramework updated: 9f456acb3c...98248e1cf4
@@ -2,6 +2,7 @@
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <time.h>
|
||||
#include <pthread.h>
|
||||
|
||||
#if defined(__PX4_APPLE_LEGACY)
|
||||
|
||||
@@ -31,10 +32,29 @@ __END_DECLS
|
||||
|
||||
#else
|
||||
|
||||
|
||||
#if 0
|
||||
#define px4_clock_gettime clock_gettime
|
||||
#define px4_clock_settime clock_settime
|
||||
|
||||
#define px4_usleep system_usleep
|
||||
#define px4_sleep system_sleep
|
||||
#define px4_pthread_cond_timedwait system_pthread_cond_timedwait
|
||||
#else
|
||||
|
||||
|
||||
__BEGIN_DECLS
|
||||
__EXPORT int px4_clock_gettime(clockid_t clk_id, struct timespec *tp);
|
||||
__EXPORT int px4_clock_settime(clockid_t clk_id, const struct timespec *tp);
|
||||
|
||||
__EXPORT int px4_usleep(useconds_t usec);
|
||||
__EXPORT unsigned int px4_sleep(unsigned int seconds);
|
||||
__EXPORT int px4_pthread_cond_timedwait(pthread_cond_t *cond,
|
||||
pthread_mutex_t *mutex,
|
||||
const struct timespec *abstime);
|
||||
__END_DECLS
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user