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