mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-07-04 12:10:34 +08:00
px4io driver: Add support for circuit breakers
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user