mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-04-14 10:07:39 +08:00
and remove the px4_ prefix, except for px4_config.h.
command to update includes:
for k in app.h atomic.h cli.h console_buffer.h defines.h getopt.h i2c.h init.h log.h micro_hal.h module.h module_params.h param.h param_macros.h posix.h sem.h sem.hpp shmem.h shutdown.h tasks.h time.h workqueue.h; do for i in $(grep -rl 'include <px4_'$k src platforms boards); do sed -i 's/#include <px4_'$k'/#include <px4_platform_common\/'$k/ $i; done; done
for in $(grep -rl 'include <px4_config.h' src platforms boards); do sed -i 's/#include <px4_config.h/#include <px4_platform_common\/px4_config.h'/ $i; done
Transitional headers for submodules are added (px4_{defines,log,time}.h)
40 lines
927 B
C
40 lines
927 B
C
#pragma once
|
|
|
|
#include <unistd.h>
|
|
#include <sys/types.h>
|
|
#include <time.h>
|
|
#include <pthread.h>
|
|
|
|
#if defined(__PX4_APPLE_LEGACY)
|
|
#define clockid_t int
|
|
#endif
|
|
|
|
#if defined(__PX4_POSIX) || defined(__PX4_QURT)
|
|
__BEGIN_DECLS
|
|
__EXPORT int px4_clock_gettime(clockid_t clk_id, struct timespec *tp);
|
|
__END_DECLS
|
|
#else
|
|
#define px4_clock_gettime system_clock_gettime
|
|
#endif
|
|
|
|
#if defined(ENABLE_LOCKSTEP_SCHEDULER)
|
|
|
|
__BEGIN_DECLS
|
|
__EXPORT int px4_clock_settime(clockid_t clk_id, const struct timespec *tp);
|
|
|
|
__EXPORT int px4_usleep(useconds_t usec);
|
|
__EXPORT unsigned int px4_sleep(unsigned int seconds);
|
|
__EXPORT int px4_pthread_cond_timedwait(pthread_cond_t *cond,
|
|
pthread_mutex_t *mutex,
|
|
const struct timespec *abstime);
|
|
__END_DECLS
|
|
|
|
#else
|
|
|
|
#define px4_clock_settime system_clock_settime
|
|
#define px4_usleep system_usleep
|
|
#define px4_sleep system_sleep
|
|
#define px4_pthread_cond_timedwait system_pthread_cond_timedwait
|
|
|
|
#endif
|