Browse Source

px4io driver: Add support for circuit breakers

sbg
Lorenz Meier 11 years ago
parent
commit
8ea5fd20c1
  1. 14
      src/drivers/px4io/px4io.cpp

14
src/drivers/px4io/px4io.cpp

@ -72,6 +72,7 @@ @@ -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() @@ -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);
}
}
}
}

Loading…
Cancel
Save