diff options
author | Lorenz Meier <lm@inf.ethz.ch> | 2014-07-02 00:33:36 +0200 |
---|---|---|
committer | Lorenz Meier <lm@inf.ethz.ch> | 2014-07-02 00:33:36 +0200 |
commit | a9fd5ed90ad67a8081aec3dd3c05034c3d64f81c (patch) | |
tree | 74065b07dc620e8e22751563d548a140b17966e4 /src/drivers/px4io | |
parent | 43b9d96cf4306bc472d16956f5437dbef7c630c0 (diff) | |
parent | 4cd66a3242aa2dfb03a3e58ffcc8d27e1350b7ac (diff) | |
download | px4-firmware-a9fd5ed90ad67a8081aec3dd3c05034c3d64f81c.tar.gz px4-firmware-a9fd5ed90ad67a8081aec3dd3c05034c3d64f81c.tar.bz2 px4-firmware-a9fd5ed90ad67a8081aec3dd3c05034c3d64f81c.zip |
Merged master to gnss_rework
Diffstat (limited to 'src/drivers/px4io')
-rw-r--r-- | src/drivers/px4io/px4io.cpp | 14 | ||||
-rw-r--r-- | src/drivers/px4io/px4io_serial.cpp | 2 |
2 files changed, 15 insertions, 1 deletions
diff --git a/src/drivers/px4io/px4io.cpp b/src/drivers/px4io/px4io.cpp index 992ab9623..24da4c68b 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> @@ -1012,6 +1013,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); + } + } + } } diff --git a/src/drivers/px4io/px4io_serial.cpp b/src/drivers/px4io/px4io_serial.cpp index 3b210ac59..c39494fb0 100644 --- a/src/drivers/px4io/px4io_serial.cpp +++ b/src/drivers/px4io/px4io_serial.cpp @@ -639,7 +639,7 @@ PX4IO_serial::_do_interrupt() if (_rx_dma_status == _dma_status_waiting) { /* verify that the received packet is complete */ - int length = sizeof(_dma_buffer) - stm32_dmaresidual(_rx_dma); + size_t length = sizeof(_dma_buffer) - stm32_dmaresidual(_rx_dma); if ((length < 1) || (length < PKT_SIZE(_dma_buffer))) { perf_count(_pc_badidle); |