mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-25 06:53:34 +08:00
platforms: use define for lockstep scheduler
Instead of using the define __PX4_POSIX_SITL it makes more sense to have a define just to determine if the lockstep scheduler should be used.
This commit is contained in:
@@ -31,7 +31,7 @@
|
||||
#
|
||||
############################################################################
|
||||
|
||||
if (LOCKSTEP_SCHEDULER_NEEDED)
|
||||
if (ENABLE_LOCKSTEP_SCHEDULER)
|
||||
add_subdirectory(lockstep_scheduler)
|
||||
endif()
|
||||
|
||||
|
||||
@@ -56,7 +56,7 @@ target_compile_definitions(px4_layer PRIVATE MODULE_NAME="px4")
|
||||
target_link_libraries(px4_layer PRIVATE work_queue)
|
||||
target_link_libraries(px4_layer PRIVATE px4_daemon)
|
||||
|
||||
if(LOCKSTEP_SCHEDULER_NEEDED)
|
||||
if(ENABLE_LOCKSTEP_SCHEDULER)
|
||||
target_link_libraries(px4_layer PRIVATE lockstep_scheduler)
|
||||
include_directories(${PX4_SOURCE_DIR}/platforms/posix/src/lockstep_scheduler/include)
|
||||
endif()
|
||||
|
||||
@@ -49,7 +49,7 @@
|
||||
#include <errno.h>
|
||||
#include "hrt_work.h"
|
||||
|
||||
#if defined(__PX4_POSIX_SITL)
|
||||
#if defined(ENABLE_LOCKSTEP_SCHEDULER)
|
||||
#include <lockstep_scheduler/lockstep_scheduler.h>
|
||||
#endif
|
||||
|
||||
@@ -72,7 +72,7 @@ static hrt_abstime _delay_interval = 0;
|
||||
static hrt_abstime max_time = 0;
|
||||
static pthread_mutex_t _hrt_mutex = PTHREAD_MUTEX_INITIALIZER;
|
||||
|
||||
#if defined(__PX4_POSIX_SITL)
|
||||
#if defined(ENABLE_LOCKSTEP_SCHEDULER)
|
||||
static LockstepScheduler lockstep_scheduler;
|
||||
#endif
|
||||
|
||||
@@ -594,7 +594,7 @@ void abstime_to_ts(struct timespec *ts, hrt_abstime abstime)
|
||||
ts->tv_nsec = abstime * 1000;
|
||||
}
|
||||
|
||||
#if defined(__PX4_POSIX_SITL)
|
||||
#if defined(ENABLE_LOCKSTEP_SCHEDULER)
|
||||
int px4_clock_gettime(clockid_t clk_id, struct timespec *tp)
|
||||
{
|
||||
if (clk_id == CLOCK_MONOTONIC) {
|
||||
|
||||
Reference in New Issue
Block a user