mirror of
https://gitee.com/xiaohuolufeihua/bizhang_-obav.git
synced 2026-05-21 01:12:11 +00:00
platforms: fix linking issues for NuttX build
This commit is contained in:
@@ -47,6 +47,7 @@
|
||||
|
||||
#include <px4_config.h>
|
||||
#include <px4_tasks.h>
|
||||
#include <px4_time.h>
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <stdio.h>
|
||||
|
||||
@@ -101,8 +101,12 @@
|
||||
// like uavcan and we don't need to fake time on the real system.
|
||||
#include <unistd.h>
|
||||
#include <time.h>
|
||||
|
||||
#define system_usleep usleep
|
||||
#define system_sleep sleep
|
||||
|
||||
#define system_clock_gettime clock_gettime
|
||||
#define system_clock_settime clock_settime
|
||||
|
||||
#pragma GCC poison getenv setenv putenv
|
||||
#endif /* __PX4_NUTTX */
|
||||
|
||||
@@ -21,7 +21,7 @@ __EXPORT unsigned int sleep(unsigned int sec);
|
||||
|
||||
__END_DECLS
|
||||
|
||||
#else
|
||||
#elif defined(__PX4_POSIX)
|
||||
|
||||
__BEGIN_DECLS
|
||||
__EXPORT int px4_clock_gettime(clockid_t clk_id, struct timespec *tp);
|
||||
@@ -34,4 +34,11 @@ __EXPORT int px4_pthread_cond_timedwait(pthread_cond_t *cond,
|
||||
const struct timespec *abstime);
|
||||
__END_DECLS
|
||||
|
||||
#elif defined(__PX4_NUTTX)
|
||||
|
||||
#define px4_clock_gettime system_clock_gettime
|
||||
#define px4_clock_settime system_clock_settime
|
||||
#define px4_usleep system_usleep
|
||||
#define px4_sleep system_sleep
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user