diff options
author | Lorenz Meier <lm@inf.ethz.ch> | 2014-05-25 20:36:05 +0200 |
---|---|---|
committer | Lorenz Meier <lm@inf.ethz.ch> | 2014-05-25 20:36:05 +0200 |
commit | 8ea5fd20c1c268c6baf145606186592bf5bd3699 (patch) | |
tree | e8be87e0ec1cc617d6ce433eaaef42144cb6064f /src | |
parent | 77365188ada556c5953f6f026566d4912e8c6e76 (diff) | |
download | px4-firmware-8ea5fd20c1c268c6baf145606186592bf5bd3699.tar.gz px4-firmware-8ea5fd20c1c268c6baf145606186592bf5bd3699.tar.bz2 px4-firmware-8ea5fd20c1c268c6baf145606186592bf5bd3699.zip |
px4io driver: Add support for circuit breakers
Diffstat (limited to 'src')
-rw-r--r-- | src/drivers/px4io/px4io.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/drivers/px4io/px4io.cpp b/src/drivers/px4io/px4io.cpp index 972f45148..c6acfe6be 100644 --- a/src/drivers/px4io/px4io.cpp +++ b/src/drivers/px4io/px4io.cpp @@ -72,6 +72,7 @@ #include <systemlib/systemlib.h> #include <systemlib/scheduling_priorities.h> #include <systemlib/param/param.h> +#include <systemlib/circuit_breaker.h> #include <uORB/topics/actuator_controls.h> #include <uORB/topics/actuator_outputs.h> @@ -1010,6 +1011,19 @@ PX4IO::task_main() } } + int32_t safety_param_val; + param_t safety_param = param_find("RC_FAILS_THR"); + + if (safety_param != PARAM_INVALID) { + + param_get(safety_param, &safety_param_val); + + if (safety_param_val == PX4IO_FORCE_SAFETY_MAGIC) { + /* disable IO safety if circuit breaker asked for it */ + (void)io_reg_set(PX4IO_PAGE_SETUP, PX4IO_P_SETUP_FORCE_SAFETY_OFF, safety_param_val); + } + } + } } |