mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-06-02 11:59:17 +08:00
move systemlib/circuit_breaker.cpp to standalone lib
This commit is contained in:
committed by
Lorenz Meier
parent
7eeba7b8ca
commit
387bc81f26
@@ -37,5 +37,6 @@ px4_add_module(
|
|||||||
SRCS
|
SRCS
|
||||||
tone_alarm.cpp
|
tone_alarm.cpp
|
||||||
DEPENDS
|
DEPENDS
|
||||||
|
circuit_breaker
|
||||||
tunes
|
tunes
|
||||||
)
|
)
|
||||||
@@ -113,7 +113,7 @@
|
|||||||
#include "kinetis_tpm.h"
|
#include "kinetis_tpm.h"
|
||||||
|
|
||||||
#include <systemlib/err.h>
|
#include <systemlib/err.h>
|
||||||
#include <systemlib/circuit_breaker.h>
|
#include <circuit_breaker/circuit_breaker.h>
|
||||||
|
|
||||||
#define CAT3_(A, B, C) A##B##C
|
#define CAT3_(A, B, C) A##B##C
|
||||||
#define CAT3(A, B, C) CAT3_(A, B, C)
|
#define CAT3(A, B, C) CAT3_(A, B, C)
|
||||||
|
|||||||
@@ -38,5 +38,6 @@ px4_add_module(
|
|||||||
SRCS
|
SRCS
|
||||||
fmu.cpp
|
fmu.cpp
|
||||||
DEPENDS
|
DEPENDS
|
||||||
|
circuit_breaker
|
||||||
rc
|
rc
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -56,7 +56,7 @@
|
|||||||
#include <px4_getopt.h>
|
#include <px4_getopt.h>
|
||||||
#include <px4_log.h>
|
#include <px4_log.h>
|
||||||
#include <px4_module.h>
|
#include <px4_module.h>
|
||||||
#include <systemlib/circuit_breaker.h>
|
#include <circuit_breaker/circuit_breaker.h>
|
||||||
#include <lib/mixer/mixer.h>
|
#include <lib/mixer/mixer.h>
|
||||||
#include <parameters/param.h>
|
#include <parameters/param.h>
|
||||||
#include <perf/perf_counter.h>
|
#include <perf/perf_counter.h>
|
||||||
|
|||||||
@@ -42,6 +42,7 @@ px4_add_module(
|
|||||||
px4io_serial_f4.cpp
|
px4io_serial_f4.cpp
|
||||||
px4io_serial_f7.cpp
|
px4io_serial_f7.cpp
|
||||||
DEPENDS
|
DEPENDS
|
||||||
|
circuit_breaker
|
||||||
)
|
)
|
||||||
|
|
||||||
# include the px4io binary in ROMFS
|
# include the px4io binary in ROMFS
|
||||||
|
|||||||
@@ -71,7 +71,7 @@
|
|||||||
#include <perf/perf_counter.h>
|
#include <perf/perf_counter.h>
|
||||||
#include <systemlib/err.h>
|
#include <systemlib/err.h>
|
||||||
#include <parameters/param.h>
|
#include <parameters/param.h>
|
||||||
#include <systemlib/circuit_breaker.h>
|
#include <circuit_breaker/circuit_breaker.h>
|
||||||
#include <systemlib/mavlink_log.h>
|
#include <systemlib/mavlink_log.h>
|
||||||
|
|
||||||
#include <uORB/topics/actuator_controls.h>
|
#include <uORB/topics/actuator_controls.h>
|
||||||
|
|||||||
@@ -37,5 +37,6 @@ px4_add_module(
|
|||||||
SRCS
|
SRCS
|
||||||
tone_alarm.cpp
|
tone_alarm.cpp
|
||||||
DEPENDS
|
DEPENDS
|
||||||
|
circuit_breaker
|
||||||
tunes
|
tunes
|
||||||
)
|
)
|
||||||
@@ -116,7 +116,7 @@
|
|||||||
#include <sam_tc.h>
|
#include <sam_tc.h>
|
||||||
|
|
||||||
#include <systemlib/err.h>
|
#include <systemlib/err.h>
|
||||||
#include <systemlib/circuit_breaker.h>
|
#include <circuit_breaker/circuit_breaker.h>
|
||||||
|
|
||||||
/* Check that tone alarm and HRT timers are different */
|
/* Check that tone alarm and HRT timers are different */
|
||||||
#if defined(TONE_ALARM_CHANNEL) && defined(HRT_TIMER_CHANNEL)
|
#if defined(TONE_ALARM_CHANNEL) && defined(HRT_TIMER_CHANNEL)
|
||||||
|
|||||||
@@ -37,5 +37,6 @@ px4_add_module(
|
|||||||
SRCS
|
SRCS
|
||||||
tone_alarm.cpp
|
tone_alarm.cpp
|
||||||
DEPENDS
|
DEPENDS
|
||||||
|
circuit_breaker
|
||||||
tunes
|
tunes
|
||||||
)
|
)
|
||||||
@@ -109,7 +109,7 @@
|
|||||||
#include <drivers/drv_hrt.h>
|
#include <drivers/drv_hrt.h>
|
||||||
|
|
||||||
#include <systemlib/err.h>
|
#include <systemlib/err.h>
|
||||||
#include <systemlib/circuit_breaker.h>
|
#include <circuit_breaker/circuit_breaker.h>
|
||||||
|
|
||||||
#include <px4_workqueue.h>
|
#include <px4_workqueue.h>
|
||||||
|
|
||||||
|
|||||||
@@ -54,7 +54,7 @@
|
|||||||
#include <parameters/param.h>
|
#include <parameters/param.h>
|
||||||
#include <systemlib/err.h>
|
#include <systemlib/err.h>
|
||||||
#include <perf/perf_counter.h>
|
#include <perf/perf_counter.h>
|
||||||
#include <systemlib/circuit_breaker.h>
|
|
||||||
// internal libraries
|
// internal libraries
|
||||||
#include <lib/mathlib/mathlib.h>
|
#include <lib/mathlib/mathlib.h>
|
||||||
#include <matrix/math.hpp>
|
#include <matrix/math.hpp>
|
||||||
|
|||||||
@@ -35,6 +35,7 @@ px4_add_git_submodule(TARGET git_ecl PATH "ecl")
|
|||||||
px4_add_git_submodule(TARGET git_matrix PATH "matrix")
|
px4_add_git_submodule(TARGET git_matrix PATH "matrix")
|
||||||
|
|
||||||
add_subdirectory(battery)
|
add_subdirectory(battery)
|
||||||
|
add_subdirectory(circuit_breaker)
|
||||||
add_subdirectory(controllib)
|
add_subdirectory(controllib)
|
||||||
add_subdirectory(conversion)
|
add_subdirectory(conversion)
|
||||||
add_subdirectory(drivers)
|
add_subdirectory(drivers)
|
||||||
|
|||||||
@@ -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(circuit_breaker circuit_breaker.cpp)
|
||||||
+2
-1
@@ -42,9 +42,10 @@
|
|||||||
* parameter needs to set to the key (magic).
|
* parameter needs to set to the key (magic).
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include "circuit_breaker.h"
|
||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <px4_defines.h>
|
#include <px4_defines.h>
|
||||||
#include <systemlib/circuit_breaker.h>
|
|
||||||
|
|
||||||
bool circuit_breaker_enabled(const char *breaker, int32_t magic)
|
bool circuit_breaker_enabled(const char *breaker, int32_t magic)
|
||||||
{
|
{
|
||||||
@@ -59,7 +59,7 @@
|
|||||||
#define CBRK_USB_CHK_KEY 197848
|
#define CBRK_USB_CHK_KEY 197848
|
||||||
#define CBRK_VELPOSERR_KEY 201607
|
#define CBRK_VELPOSERR_KEY 201607
|
||||||
|
|
||||||
#include <stdbool.h>
|
#include <stdint.h>
|
||||||
|
|
||||||
__BEGIN_DECLS
|
__BEGIN_DECLS
|
||||||
|
|
||||||
@@ -54,6 +54,7 @@ px4_add_module(
|
|||||||
rc_check.cpp
|
rc_check.cpp
|
||||||
state_machine_helper.cpp
|
state_machine_helper.cpp
|
||||||
DEPENDS
|
DEPENDS
|
||||||
|
circuit_breaker
|
||||||
df_driver_framework
|
df_driver_framework
|
||||||
git_ecl
|
git_ecl
|
||||||
ecl_geo
|
ecl_geo
|
||||||
|
|||||||
@@ -73,7 +73,7 @@
|
|||||||
#include <px4_shutdown.h>
|
#include <px4_shutdown.h>
|
||||||
#include <px4_tasks.h>
|
#include <px4_tasks.h>
|
||||||
#include <px4_time.h>
|
#include <px4_time.h>
|
||||||
#include <systemlib/circuit_breaker.h>
|
#include <circuit_breaker/circuit_breaker.h>
|
||||||
#include <systemlib/err.h>
|
#include <systemlib/err.h>
|
||||||
#include <systemlib/hysteresis/hysteresis.h>
|
#include <systemlib/hysteresis/hysteresis.h>
|
||||||
#include <systemlib/mavlink_log.h>
|
#include <systemlib/mavlink_log.h>
|
||||||
|
|||||||
@@ -40,6 +40,7 @@ px4_add_module(
|
|||||||
SRCS
|
SRCS
|
||||||
mc_att_control_main.cpp
|
mc_att_control_main.cpp
|
||||||
DEPENDS
|
DEPENDS
|
||||||
|
circuit_breaker
|
||||||
conversion
|
conversion
|
||||||
mathlib
|
mathlib
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -48,7 +48,7 @@
|
|||||||
#include <conversion/rotation.h>
|
#include <conversion/rotation.h>
|
||||||
#include <drivers/drv_hrt.h>
|
#include <drivers/drv_hrt.h>
|
||||||
#include <lib/ecl/geo/geo.h>
|
#include <lib/ecl/geo/geo.h>
|
||||||
#include <systemlib/circuit_breaker.h>
|
#include <circuit_breaker/circuit_breaker.h>
|
||||||
#include <mathlib/math/Limits.hpp>
|
#include <mathlib/math/Limits.hpp>
|
||||||
#include <mathlib/math/Functions.hpp>
|
#include <mathlib/math/Functions.hpp>
|
||||||
|
|
||||||
|
|||||||
@@ -33,7 +33,6 @@
|
|||||||
|
|
||||||
set(SRCS
|
set(SRCS
|
||||||
airspeed.cpp
|
airspeed.cpp
|
||||||
circuit_breaker.cpp
|
|
||||||
conversions.c
|
conversions.c
|
||||||
cpuload.c
|
cpuload.c
|
||||||
crc.c
|
crc.c
|
||||||
|
|||||||
Reference in New Issue
Block a user