platforms: fix linking issues for NuttX build

This commit is contained in:
Julian Oes
2018-11-15 11:36:33 +01:00
parent a193e4117c
commit 8cbe26c6f6
3 changed files with 13 additions and 1 deletions

View File

@@ -47,6 +47,7 @@
#include <px4_config.h>
#include <px4_tasks.h>
#include <px4_time.h>
#include <stdbool.h>
#include <stdio.h>

View File

@@ -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 */

View File

@@ -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