diff --git a/CMakeLists.txt b/CMakeLists.txt index 1dd8091769..6385538b19 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -418,7 +418,6 @@ include(px4_add_library) add_subdirectory(src/lib EXCLUDE_FROM_ALL) add_subdirectory(src/platforms EXCLUDE_FROM_ALL) -add_subdirectory(src/modules/systemlib EXCLUDE_FROM_ALL) # TODO: split into libraries in platform layer add_subdirectory(src/modules/uORB EXCLUDE_FROM_ALL) # TODO: platform layer add_subdirectory(src/drivers/boards EXCLUDE_FROM_ALL) diff --git a/Tools/astyle/files_to_check_code_style.sh b/Tools/astyle/files_to_check_code_style.sh index 2bfee94f3b..68cc410118 100755 --- a/Tools/astyle/files_to_check_code_style.sh +++ b/Tools/astyle/files_to_check_code_style.sh @@ -10,10 +10,10 @@ fi exec find boards src platforms \ -path platforms/nuttx/NuttX -prune -o \ + -path src/drivers/uavcan/libuavcan -prune -o \ -path src/lib/DriverFramework -prune -o \ -path src/lib/ecl -prune -o \ -path src/lib/matrix -prune -o \ + -path src/lib/systemlib/uthash -prune -o \ -path src/modules/micrortps_bridge/micro-CDR -prune -o \ - -path src/modules/systemlib/uthash -prune -o \ - -path src/drivers/uavcan/libuavcan -prune -o \ -type f \( -name "*.c" -o -name "*.h" -o -name "*.cpp" -o -name "*.hpp" \) | grep $PATTERN diff --git a/src/lib/CMakeLists.txt b/src/lib/CMakeLists.txt index 24d7ec156a..4c139a39c6 100644 --- a/src/lib/CMakeLists.txt +++ b/src/lib/CMakeLists.txt @@ -53,6 +53,7 @@ add_subdirectory(perf) add_subdirectory(pid) add_subdirectory(pwm_limit) add_subdirectory(rc) +add_subdirectory(systemlib) add_subdirectory(terrain_estimation) add_subdirectory(tunes) add_subdirectory(version) diff --git a/src/modules/systemlib/CMakeLists.txt b/src/lib/systemlib/CMakeLists.txt similarity index 89% rename from src/modules/systemlib/CMakeLists.txt rename to src/lib/systemlib/CMakeLists.txt index 0a61c6455b..87737454d9 100644 --- a/src/modules/systemlib/CMakeLists.txt +++ b/src/lib/systemlib/CMakeLists.txt @@ -50,10 +50,4 @@ else() ) endif() -# TODO: find a better way to do this -if (NOT "${PX4_BOARD}" MATCHES "px4_io") - px4_add_library(systemlib ${SRCS}) -else() - add_library(systemlib ${PX4_SOURCE_DIR}/src/platforms/empty.c) - add_dependencies(systemlib prebuild_targets) -endif() +px4_add_library(systemlib ${SRCS}) diff --git a/src/modules/systemlib/conversions.c b/src/lib/systemlib/conversions.c similarity index 100% rename from src/modules/systemlib/conversions.c rename to src/lib/systemlib/conversions.c diff --git a/src/modules/systemlib/conversions.h b/src/lib/systemlib/conversions.h similarity index 100% rename from src/modules/systemlib/conversions.h rename to src/lib/systemlib/conversions.h diff --git a/src/modules/systemlib/cpuload.c b/src/lib/systemlib/cpuload.c similarity index 100% rename from src/modules/systemlib/cpuload.c rename to src/lib/systemlib/cpuload.c diff --git a/src/modules/systemlib/cpuload.h b/src/lib/systemlib/cpuload.h similarity index 100% rename from src/modules/systemlib/cpuload.h rename to src/lib/systemlib/cpuload.h diff --git a/src/modules/systemlib/crc.c b/src/lib/systemlib/crc.c similarity index 100% rename from src/modules/systemlib/crc.c rename to src/lib/systemlib/crc.c diff --git a/src/modules/systemlib/crc.h b/src/lib/systemlib/crc.h similarity index 100% rename from src/modules/systemlib/crc.h rename to src/lib/systemlib/crc.h diff --git a/src/modules/systemlib/err.h b/src/lib/systemlib/err.h similarity index 100% rename from src/modules/systemlib/err.h rename to src/lib/systemlib/err.h diff --git a/src/modules/systemlib/hardfault_log.h b/src/lib/systemlib/hardfault_log.h similarity index 100% rename from src/modules/systemlib/hardfault_log.h rename to src/lib/systemlib/hardfault_log.h diff --git a/src/modules/systemlib/hysteresis/hysteresis.cpp b/src/lib/systemlib/hysteresis/hysteresis.cpp similarity index 100% rename from src/modules/systemlib/hysteresis/hysteresis.cpp rename to src/lib/systemlib/hysteresis/hysteresis.cpp diff --git a/src/modules/systemlib/hysteresis/hysteresis.h b/src/lib/systemlib/hysteresis/hysteresis.h similarity index 100% rename from src/modules/systemlib/hysteresis/hysteresis.h rename to src/lib/systemlib/hysteresis/hysteresis.h diff --git a/src/modules/systemlib/mavlink_log.c b/src/lib/systemlib/mavlink_log.c similarity index 100% rename from src/modules/systemlib/mavlink_log.c rename to src/lib/systemlib/mavlink_log.c diff --git a/src/modules/systemlib/mavlink_log.h b/src/lib/systemlib/mavlink_log.h similarity index 100% rename from src/modules/systemlib/mavlink_log.h rename to src/lib/systemlib/mavlink_log.h diff --git a/src/modules/systemlib/otp.c b/src/lib/systemlib/otp.c similarity index 100% rename from src/modules/systemlib/otp.c rename to src/lib/systemlib/otp.c diff --git a/src/modules/systemlib/otp.h b/src/lib/systemlib/otp.h similarity index 100% rename from src/modules/systemlib/otp.h rename to src/lib/systemlib/otp.h diff --git a/src/modules/systemlib/ppm_decode.h b/src/lib/systemlib/ppm_decode.h similarity index 100% rename from src/modules/systemlib/ppm_decode.h rename to src/lib/systemlib/ppm_decode.h diff --git a/src/modules/systemlib/print_load_nuttx.c b/src/lib/systemlib/print_load_nuttx.c similarity index 100% rename from src/modules/systemlib/print_load_nuttx.c rename to src/lib/systemlib/print_load_nuttx.c diff --git a/src/modules/systemlib/print_load_posix.c b/src/lib/systemlib/print_load_posix.c similarity index 100% rename from src/modules/systemlib/print_load_posix.c rename to src/lib/systemlib/print_load_posix.c diff --git a/src/modules/systemlib/printload.h b/src/lib/systemlib/printload.h similarity index 100% rename from src/modules/systemlib/printload.h rename to src/lib/systemlib/printload.h diff --git a/src/modules/systemlib/px4_macros.h b/src/lib/systemlib/px4_macros.h similarity index 100% rename from src/modules/systemlib/px4_macros.h rename to src/lib/systemlib/px4_macros.h diff --git a/src/modules/systemlib/system_params.c b/src/lib/systemlib/system_params.c similarity index 100% rename from src/modules/systemlib/system_params.c rename to src/lib/systemlib/system_params.c diff --git a/src/modules/systemlib/uthash/doc/userguide.txt b/src/lib/systemlib/uthash/doc/userguide.txt similarity index 100% rename from src/modules/systemlib/uthash/doc/userguide.txt rename to src/lib/systemlib/uthash/doc/userguide.txt diff --git a/src/modules/systemlib/uthash/doc/utarray.txt b/src/lib/systemlib/uthash/doc/utarray.txt similarity index 100% rename from src/modules/systemlib/uthash/doc/utarray.txt rename to src/lib/systemlib/uthash/doc/utarray.txt diff --git a/src/modules/systemlib/uthash/doc/utlist.txt b/src/lib/systemlib/uthash/doc/utlist.txt similarity index 100% rename from src/modules/systemlib/uthash/doc/utlist.txt rename to src/lib/systemlib/uthash/doc/utlist.txt diff --git a/src/modules/systemlib/uthash/doc/utstring.txt b/src/lib/systemlib/uthash/doc/utstring.txt similarity index 100% rename from src/modules/systemlib/uthash/doc/utstring.txt rename to src/lib/systemlib/uthash/doc/utstring.txt diff --git a/src/modules/systemlib/uthash/utarray.h b/src/lib/systemlib/uthash/utarray.h similarity index 100% rename from src/modules/systemlib/uthash/utarray.h rename to src/lib/systemlib/uthash/utarray.h diff --git a/src/modules/systemlib/uthash/uthash.h b/src/lib/systemlib/uthash/uthash.h similarity index 100% rename from src/modules/systemlib/uthash/uthash.h rename to src/lib/systemlib/uthash/uthash.h diff --git a/src/modules/systemlib/uthash/utlist.h b/src/lib/systemlib/uthash/utlist.h similarity index 100% rename from src/modules/systemlib/uthash/utlist.h rename to src/lib/systemlib/uthash/utlist.h diff --git a/src/modules/systemlib/uthash/utstring.h b/src/lib/systemlib/uthash/utstring.h similarity index 100% rename from src/modules/systemlib/uthash/utstring.h rename to src/lib/systemlib/uthash/utstring.h