Browse Source

platforms: fix linking issues for NuttX build

sbg
Julian Oes 6 years ago
parent
commit
8cbe26c6f6
  1. 1
      boards/px4/fmu-v2/src/init.c
  2. 4
      src/include/visibility.h
  3. 9
      src/platforms/px4_time.h

1
boards/px4/fmu-v2/src/init.c

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

4
src/include/visibility.h

@ -101,8 +101,12 @@ @@ -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 */

9
src/platforms/px4_time.h

@ -21,7 +21,7 @@ __EXPORT unsigned int sleep(unsigned int sec); @@ -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, @@ -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

Loading…
Cancel
Save