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:
Julian Oes
2018-12-22 10:32:18 +01:00
parent 73578a593f
commit 547dd8511b
8 changed files with 18 additions and 10 deletions
+1 -1
View File
@@ -31,7 +31,7 @@
#
############################################################################
if (LOCKSTEP_SCHEDULER_NEEDED)
if (ENABLE_LOCKSTEP_SCHEDULER)
add_subdirectory(lockstep_scheduler)
endif()
+1 -1
View File
@@ -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()
+3 -3
View File
@@ -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) {