aboutsummaryrefslogtreecommitdiff
path: root/src/drivers
diff options
context:
space:
mode:
authorLorenz Meier <lm@inf.ethz.ch>2013-12-25 15:11:48 +0100
committerLorenz Meier <lm@inf.ethz.ch>2013-12-25 15:11:48 +0100
commitedffade8cec2ea779040e97fb5478e0e9db12031 (patch)
tree1560c0e4cc3f5c58b092e86cd30beb7524ff5a46 /src/drivers
parenta5023329920d5ce45c5bf48ae61d621947cdb349 (diff)
downloadpx4-firmware-edffade8cec2ea779040e97fb5478e0e9db12031.tar.gz
px4-firmware-edffade8cec2ea779040e97fb5478e0e9db12031.tar.bz2
px4-firmware-edffade8cec2ea779040e97fb5478e0e9db12031.zip
Added PPM frame length feedback in IO comms and status command - allows to warn users about badly formatted PPM frames
Diffstat (limited to 'src/drivers')
-rw-r--r--src/drivers/px4io/px4io.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/drivers/px4io/px4io.cpp b/src/drivers/px4io/px4io.cpp
index b80844c5b..010272c6f 100644
--- a/src/drivers/px4io/px4io.cpp
+++ b/src/drivers/px4io/px4io.cpp
@@ -1724,6 +1724,16 @@ PX4IO::print_status()
printf(" %u", io_reg_get(PX4IO_PAGE_RAW_RC_INPUT, PX4IO_P_RAW_RC_BASE + i));
printf("\n");
+
+ if (raw_inputs > 0) {
+ int frame_len = io_reg_get(PX4IO_PAGE_STATUS, PX4IO_P_STATUS_RC_DATA);
+ printf("RC data (PPM frame len) %u us\n", frame_len);
+
+ if ((frame_len - raw_inputs * 2000 - 3000) < 0) {
+ printf("WARNING WARNING WARNING! This RC receiver does not allow safe frame detection.\n");
+ }
+ }
+
uint16_t mapped_inputs = io_reg_get(PX4IO_PAGE_RC_INPUT, PX4IO_P_RC_VALID);
printf("mapped R/C inputs 0x%04x", mapped_inputs);