diff --git a/src/drivers/linux_pwm_out/CMakeLists.txt b/src/drivers/linux_pwm_out/CMakeLists.txt index bbbfcc4f53..b2b5715828 100644 --- a/src/drivers/linux_pwm_out/CMakeLists.txt +++ b/src/drivers/linux_pwm_out/CMakeLists.txt @@ -40,5 +40,6 @@ px4_add_module( linux_pwm_out.cpp ocpoc_mmap.cpp DEPENDS + pwm_limit ) diff --git a/src/drivers/linux_pwm_out/linux_pwm_out.cpp b/src/drivers/linux_pwm_out/linux_pwm_out.cpp index 73b7350b82..c076e72eca 100644 --- a/src/drivers/linux_pwm_out/linux_pwm_out.cpp +++ b/src/drivers/linux_pwm_out/linux_pwm_out.cpp @@ -51,7 +51,7 @@ #include #include #include -#include +#include #include #include "common.h" diff --git a/src/drivers/mkblctrl/CMakeLists.txt b/src/drivers/mkblctrl/CMakeLists.txt index eebea04cd4..450e7a5e2c 100644 --- a/src/drivers/mkblctrl/CMakeLists.txt +++ b/src/drivers/mkblctrl/CMakeLists.txt @@ -38,5 +38,6 @@ px4_add_module( mkblctrl.cpp mkblctrl_params.c DEPENDS + mixer ) diff --git a/src/drivers/pwm_out_sim/CMakeLists.txt b/src/drivers/pwm_out_sim/CMakeLists.txt index 8c29e4a7d3..be07621b6a 100644 --- a/src/drivers/pwm_out_sim/CMakeLists.txt +++ b/src/drivers/pwm_out_sim/CMakeLists.txt @@ -35,4 +35,6 @@ px4_add_module( MAIN pwm_out_sim SRCS PWMSim.cpp + DEPENDS + mixer ) diff --git a/src/drivers/px4fmu/CMakeLists.txt b/src/drivers/px4fmu/CMakeLists.txt index 60867d2697..1f36779a24 100644 --- a/src/drivers/px4fmu/CMakeLists.txt +++ b/src/drivers/px4fmu/CMakeLists.txt @@ -39,5 +39,7 @@ px4_add_module( fmu.cpp DEPENDS circuit_breaker + mixer rc + pwm_limit ) diff --git a/src/drivers/px4fmu/fmu.cpp b/src/drivers/px4fmu/fmu.cpp index 7a9e22cc7e..b7f8abc818 100644 --- a/src/drivers/px4fmu/fmu.cpp +++ b/src/drivers/px4fmu/fmu.cpp @@ -60,7 +60,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/src/drivers/px4io/CMakeLists.txt b/src/drivers/px4io/CMakeLists.txt index 0d779b3334..24068de454 100644 --- a/src/drivers/px4io/CMakeLists.txt +++ b/src/drivers/px4io/CMakeLists.txt @@ -43,6 +43,7 @@ px4_add_module( px4io_serial_f7.cpp DEPENDS circuit_breaker + mixer ) # include the px4io binary in ROMFS diff --git a/src/drivers/snapdragon_pwm_out/CMakeLists.txt b/src/drivers/snapdragon_pwm_out/CMakeLists.txt index 9e232b59ca..cf0a14f77e 100644 --- a/src/drivers/snapdragon_pwm_out/CMakeLists.txt +++ b/src/drivers/snapdragon_pwm_out/CMakeLists.txt @@ -38,4 +38,5 @@ px4_add_module( snapdragon_pwm_out.cpp DEPENDS mixer + pwm_limit ) diff --git a/src/drivers/snapdragon_pwm_out/snapdragon_pwm_out.cpp b/src/drivers/snapdragon_pwm_out/snapdragon_pwm_out.cpp index e28439ef34..f50059f681 100644 --- a/src/drivers/snapdragon_pwm_out/snapdragon_pwm_out.cpp +++ b/src/drivers/snapdragon_pwm_out/snapdragon_pwm_out.cpp @@ -48,12 +48,12 @@ #include #include -#include -#include -#include +#include +#include +#include #include #include -#include +#include #include /* diff --git a/src/drivers/tap_esc/CMakeLists.txt b/src/drivers/tap_esc/CMakeLists.txt index 8b8b6b1fea..fc77f26cea 100644 --- a/src/drivers/tap_esc/CMakeLists.txt +++ b/src/drivers/tap_esc/CMakeLists.txt @@ -39,5 +39,7 @@ px4_add_module( tap_esc.cpp tap_esc_common.cpp DEPENDS + mixer + pwm_limit ) diff --git a/src/drivers/tap_esc/tap_esc.cpp b/src/drivers/tap_esc/tap_esc.cpp index a48c1bbf28..7db89d36a9 100644 --- a/src/drivers/tap_esc/tap_esc.cpp +++ b/src/drivers/tap_esc/tap_esc.cpp @@ -59,8 +59,8 @@ #include #include -#include -#include +#include +#include #include "tap_esc_common.h" diff --git a/src/lib/CMakeLists.txt b/src/lib/CMakeLists.txt index 8aa234c76d..1a3ed5ff16 100644 --- a/src/lib/CMakeLists.txt +++ b/src/lib/CMakeLists.txt @@ -45,6 +45,7 @@ add_subdirectory(led) add_subdirectory(mathlib) add_subdirectory(mixer) add_subdirectory(perf) +add_subdirectory(pwm_limit) add_subdirectory(rc) add_subdirectory(terrain_estimation) add_subdirectory(tunes) diff --git a/src/lib/pwm_limit/CMakeLists.txt b/src/lib/pwm_limit/CMakeLists.txt new file mode 100644 index 0000000000..3ffea359dd --- /dev/null +++ b/src/lib/pwm_limit/CMakeLists.txt @@ -0,0 +1,34 @@ +############################################################################ +# +# Copyright (c) 2018 PX4 Development Team. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in +# the documentation and/or other materials provided with the +# distribution. +# 3. Neither the name PX4 nor the names of its contributors may be +# used to endorse or promote products derived from this software +# without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS +# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED +# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +# POSSIBILITY OF SUCH DAMAGE. +# +############################################################################ + +px4_add_library(pwm_limit pwm_limit.c) diff --git a/src/modules/systemlib/pwm_limit/pwm_limit.c b/src/lib/pwm_limit/pwm_limit.c similarity index 99% rename from src/modules/systemlib/pwm_limit/pwm_limit.c rename to src/lib/pwm_limit/pwm_limit.c index 2c587541e3..1243ccf493 100644 --- a/src/modules/systemlib/pwm_limit/pwm_limit.c +++ b/src/lib/pwm_limit/pwm_limit.c @@ -41,6 +41,7 @@ */ #include "pwm_limit.h" + #include #include #include diff --git a/src/modules/systemlib/pwm_limit/pwm_limit.h b/src/lib/pwm_limit/pwm_limit.h similarity index 100% rename from src/modules/systemlib/pwm_limit/pwm_limit.h rename to src/lib/pwm_limit/pwm_limit.h diff --git a/src/modules/px4iofirmware/CMakeLists.txt b/src/modules/px4iofirmware/CMakeLists.txt index 0569cf462c..b3a37b6220 100644 --- a/src/modules/px4iofirmware/CMakeLists.txt +++ b/src/modules/px4iofirmware/CMakeLists.txt @@ -33,7 +33,6 @@ add_library(px4iofirmware hx_stream.c - ../systemlib/pwm_limit/pwm_limit.c adc.c controls.c mixer.cpp @@ -52,4 +51,5 @@ target_link_libraries(px4iofirmware mixer rc perf + pwm_limit ) \ No newline at end of file diff --git a/src/modules/px4iofirmware/mixer.cpp b/src/modules/px4iofirmware/mixer.cpp index 7aec22234b..317e6ef2ec 100644 --- a/src/modules/px4iofirmware/mixer.cpp +++ b/src/modules/px4iofirmware/mixer.cpp @@ -49,10 +49,11 @@ #include #include + +#include +#include #include -#include -#include #include #include "mixer.h" diff --git a/src/modules/px4iofirmware/px4io.c b/src/modules/px4iofirmware/px4io.c index 5af43cdfb1..0c757d843e 100644 --- a/src/modules/px4iofirmware/px4io.c +++ b/src/modules/px4iofirmware/px4io.c @@ -55,7 +55,7 @@ #include #include -#include +#include #include diff --git a/src/modules/px4iofirmware/px4io.h b/src/modules/px4iofirmware/px4io.h index 10db31a277..3752f9cf10 100644 --- a/src/modules/px4iofirmware/px4io.h +++ b/src/modules/px4iofirmware/px4io.h @@ -50,7 +50,7 @@ #include "protocol.h" -#include +#include /* hotfix: we are critically short of memory in px4io and this is the diff --git a/src/modules/systemlib/CMakeLists.txt b/src/modules/systemlib/CMakeLists.txt index 16ec98603c..68ba78bfde 100644 --- a/src/modules/systemlib/CMakeLists.txt +++ b/src/modules/systemlib/CMakeLists.txt @@ -40,7 +40,6 @@ set(SRCS mavlink_log.c otp.c pid/pid.c - pwm_limit/pwm_limit.c ) if(${OS} STREQUAL "nuttx") diff --git a/src/modules/uavcan/CMakeLists.txt b/src/modules/uavcan/CMakeLists.txt index 1051ef0fd1..0f2c34259a 100644 --- a/src/modules/uavcan/CMakeLists.txt +++ b/src/modules/uavcan/CMakeLists.txt @@ -82,6 +82,8 @@ px4_add_module( sensors/baro.cpp DEPENDS + mixer + git_uavcan # within libuavcan diff --git a/src/modules/vtol_att_control/CMakeLists.txt b/src/modules/vtol_att_control/CMakeLists.txt index b26c00baaf..a5f5dabc8d 100644 --- a/src/modules/vtol_att_control/CMakeLists.txt +++ b/src/modules/vtol_att_control/CMakeLists.txt @@ -42,5 +42,6 @@ px4_add_module( tailsitter.cpp standard.cpp DEPENDS + pwm_limit ) diff --git a/src/systemcmds/tests/CMakeLists.txt b/src/systemcmds/tests/CMakeLists.txt index ba196381f6..b88b2f796d 100644 --- a/src/systemcmds/tests/CMakeLists.txt +++ b/src/systemcmds/tests/CMakeLists.txt @@ -93,4 +93,5 @@ px4_add_module( modules__mc_pos_control__mc_pos_control_tests git_ecl ecl_geo_lookup # TODO: move this + pwm_limit ) diff --git a/src/systemcmds/tests/test_mixer.cpp b/src/systemcmds/tests/test_mixer.cpp index c448a4ebb3..4173ce6996 100644 --- a/src/systemcmds/tests/test_mixer.cpp +++ b/src/systemcmds/tests/test_mixer.cpp @@ -42,8 +42,8 @@ #include #include -#include -#include +#include +#include #include #include #include