mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-06-26 02:40:34 +08:00
platforms: fix clock build for macOS (yet again)
This commit is contained in:
+1
-1
Submodule src/lib/DriverFramework updated: 701a35b42a...28ccde918b
@@ -379,8 +379,8 @@ extern "C" {
|
||||
|
||||
// Get the current time
|
||||
struct timespec ts;
|
||||
// px4_sem_timedwait is implemented using CLOCK_MONOTONIC,
|
||||
// at least for lockstep, on Qurt and on Linux.
|
||||
// Note, we can't actually use CLOCK_MONOTONIC on macOS
|
||||
// but that's hidden and implemented in px4_clock_gettime.
|
||||
px4_clock_gettime(CLOCK_MONOTONIC, &ts);
|
||||
|
||||
// Calculate an absolute time in the future
|
||||
|
||||
@@ -9,10 +9,11 @@
|
||||
#define clockid_t int
|
||||
#endif
|
||||
|
||||
__EXPORT int px4_clock_gettime(clockid_t clk_id, struct timespec *tp);
|
||||
|
||||
#if defined(ENABLE_LOCKSTEP_SCHEDULER) || defined(__PX4_QURT)
|
||||
|
||||
__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);
|
||||
@@ -24,7 +25,6 @@ __END_DECLS
|
||||
|
||||
#else
|
||||
|
||||
#define px4_clock_gettime system_clock_gettime
|
||||
#define px4_clock_settime system_clock_settime
|
||||
#define px4_usleep system_usleep
|
||||
#define px4_sleep system_sleep
|
||||
|
||||
Reference in New Issue
Block a user