diff options
author | Thomas Gubler <thomasgubler@gmail.com> | 2014-12-16 08:24:51 +0100 |
---|---|---|
committer | Thomas Gubler <thomasgubler@gmail.com> | 2014-12-16 08:24:51 +0100 |
commit | 9520983e08397c453af735d0ff0736cc007c2c45 (patch) | |
tree | 171df31a96bd6863c5dfd94242274177f9413dd2 /src/modules/systemlib | |
parent | 9980e4482146333340cc105b560bdbd26acb999f (diff) | |
download | px4-firmware-9520983e08397c453af735d0ff0736cc007c2c45.tar.gz px4-firmware-9520983e08397c453af735d0ff0736cc007c2c45.tar.bz2 px4-firmware-9520983e08397c453af735d0ff0736cc007c2c45.zip |
lots' of header juggling and small changes to make mc att control compile for NuttX and ROS
Diffstat (limited to 'src/modules/systemlib')
-rw-r--r-- | src/modules/systemlib/circuit_breaker.c | 17 | ||||
-rw-r--r-- | src/modules/systemlib/circuit_breaker.h | 8 | ||||
-rw-r--r-- | src/modules/systemlib/circuit_breaker_params.h | 7 | ||||
-rw-r--r-- | src/modules/systemlib/perf_counter.h | 1 |
4 files changed, 24 insertions, 9 deletions
diff --git a/src/modules/systemlib/circuit_breaker.c b/src/modules/systemlib/circuit_breaker.c index 12187d70e..1b3ffd59f 100644 --- a/src/modules/systemlib/circuit_breaker.c +++ b/src/modules/systemlib/circuit_breaker.c @@ -42,7 +42,8 @@ * parameter needs to set to the key (magic). */ -#include <systemlib/param/param.h> +#include <px4.h> +#include <systemlib/circuit_breaker_params.h> #include <systemlib/circuit_breaker.h> /** @@ -56,7 +57,7 @@ * @max 894281 * @group Circuit Breaker */ -PARAM_DEFINE_INT32(CBRK_SUPPLY_CHK, 0); +PX4_PARAM_DEFINE_INT32(CBRK_SUPPLY_CHK); /** * Circuit breaker for rate controller output @@ -69,7 +70,7 @@ PARAM_DEFINE_INT32(CBRK_SUPPLY_CHK, 0); * @max 140253 * @group Circuit Breaker */ -PARAM_DEFINE_INT32(CBRK_RATE_CTRL, 0); +PX4_PARAM_DEFINE_INT32(CBRK_RATE_CTRL); /** * Circuit breaker for IO safety @@ -81,7 +82,7 @@ PARAM_DEFINE_INT32(CBRK_RATE_CTRL, 0); * @max 22027 * @group Circuit Breaker */ -PARAM_DEFINE_INT32(CBRK_IO_SAFETY, 0); +PX4_PARAM_DEFINE_INT32(CBRK_IO_SAFETY); /** * Circuit breaker for airspeed sensor @@ -93,7 +94,7 @@ PARAM_DEFINE_INT32(CBRK_IO_SAFETY, 0); * @max 162128 * @group Circuit Breaker */ -PARAM_DEFINE_INT32(CBRK_AIRSPD_CHK, 0); +PX4_PARAM_DEFINE_INT32(CBRK_AIRSPD_CHK); /** * Circuit breaker for flight termination @@ -106,7 +107,7 @@ PARAM_DEFINE_INT32(CBRK_AIRSPD_CHK, 0); * @max 121212 * @group Circuit Breaker */ -PARAM_DEFINE_INT32(CBRK_FLIGHTTERM, 121212); +PX4_PARAM_DEFINE_INT32(CBRK_FLIGHTTERM); /** * Circuit breaker for engine failure detection @@ -120,7 +121,7 @@ PARAM_DEFINE_INT32(CBRK_FLIGHTTERM, 121212); * @max 284953 * @group Circuit Breaker */ -PARAM_DEFINE_INT32(CBRK_ENGINEFAIL, 284953); +PX4_PARAM_DEFINE_INT32(CBRK_ENGINEFAIL); /** * Circuit breaker for gps failure detection @@ -134,7 +135,7 @@ PARAM_DEFINE_INT32(CBRK_ENGINEFAIL, 284953); * @max 240024 * @group Circuit Breaker */ -PARAM_DEFINE_INT32(CBRK_GPSFAIL, 240024); +PX4_PARAM_DEFINE_INT32(CBRK_GPSFAIL); bool circuit_breaker_enabled(const char* breaker, int32_t magic) { diff --git a/src/modules/systemlib/circuit_breaker.h b/src/modules/systemlib/circuit_breaker.h index b3431722f..012d8cb61 100644 --- a/src/modules/systemlib/circuit_breaker.h +++ b/src/modules/systemlib/circuit_breaker.h @@ -61,8 +61,14 @@ __BEGIN_DECLS +#ifdef __cplusplus +extern "C" { +#endif +__EXPORT bool circuit_breaker_enabled(const char* breaker, int32_t magic); +#ifdef __cplusplus +} +#endif __EXPORT bool circuit_breaker_enabled(const char* breaker, int32_t magic); - __END_DECLS #endif /* CIRCUIT_BREAKER_H_ */ diff --git a/src/modules/systemlib/circuit_breaker_params.h b/src/modules/systemlib/circuit_breaker_params.h new file mode 100644 index 000000000..768bf7f53 --- /dev/null +++ b/src/modules/systemlib/circuit_breaker_params.h @@ -0,0 +1,7 @@ +#define PARAM_CBRK_SUPPLY_CHK_DEFAULT 0 +#define PARAM_CBRK_RATE_CTRL_DEFAULT 0 +#define PARAM_CBRK_IO_SAFETY_DEFAULT 0 +#define PARAM_CBRK_AIRSPD_CHK_DEFAULT 0 +#define PARAM_CBRK_FLIGHTTERM_DEFAULT 121212 +#define PARAM_CBRK_ENGINEFAIL_DEFAULT 284953 +#define PARAM_CBRK_GPSFAIL_DEFAULT 240024 diff --git a/src/modules/systemlib/perf_counter.h b/src/modules/systemlib/perf_counter.h index 668d9dfdf..a9dfb13f8 100644 --- a/src/modules/systemlib/perf_counter.h +++ b/src/modules/systemlib/perf_counter.h @@ -40,6 +40,7 @@ #define _SYSTEMLIB_PERF_COUNTER_H value #include <stdint.h> +#include <platforms/px4_defines.h> /** * Counter types. |