diff options
author | px4dev <px4@purgatory.org> | 2013-02-24 14:30:56 -0800 |
---|---|---|
committer | px4dev <px4@purgatory.org> | 2013-02-24 14:30:56 -0800 |
commit | 93f6edfe64780f1132cf8cb44afe3c7f1477f94e (patch) | |
tree | d52019f5755b38016383df389590f3a002abde3c /apps/drivers | |
parent | 776cf6093c97a6bb4c8fe9543b91c7039708fc85 (diff) | |
download | px4-firmware-93f6edfe64780f1132cf8cb44afe3c7f1477f94e.tar.gz px4-firmware-93f6edfe64780f1132cf8cb44afe3c7f1477f94e.tar.bz2 px4-firmware-93f6edfe64780f1132cf8cb44afe3c7f1477f94e.zip |
Fix reporting of R/C input config
Diffstat (limited to 'apps/drivers')
-rw-r--r-- | apps/drivers/px4io/px4io.cpp | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/apps/drivers/px4io/px4io.cpp b/apps/drivers/px4io/px4io.cpp index 2488f8022..3872d7201 100644 --- a/apps/drivers/px4io/px4io.cpp +++ b/apps/drivers/px4io/px4io.cpp @@ -1228,7 +1228,7 @@ PX4IO::print_status() printf(" %u", io_reg_get(PX4IO_PAGE_RAW_ADC_INPUT, i)); printf("\n"); - /* setup */ + /* setup and state */ printf("features 0x%04x\n", io_reg_get(PX4IO_PAGE_SETUP, PX4IO_P_SETUP_FEATURES)); uint16_t arming = io_reg_get(PX4IO_PAGE_SETUP, PX4IO_P_SETUP_ARMING); printf("arming 0x%04x%s%s%s%s\n", @@ -1251,6 +1251,20 @@ PX4IO::print_status() for (unsigned i = 0; i < _max_actuators; i++) printf(" %u", io_reg_get(PX4IO_PAGE_FAILSAFE_PWM, i)); printf("\n"); + for (unsigned i = 0; i < _max_rc_input; i++) { + unsigned base = PX4IO_P_RC_CONFIG_STRIDE * i; + uint16_t options = io_reg_get(PX4IO_PAGE_RC_CONFIG, base + PX4IO_P_RC_CONFIG_OPTIONS); + printf("input %u min %u center %u max %u deadzone %u assigned %u options 0x%04x%s%s\n", + i, + io_reg_get(PX4IO_PAGE_RC_CONFIG, base + PX4IO_P_RC_CONFIG_MIN), + io_reg_get(PX4IO_PAGE_RC_CONFIG, base + PX4IO_P_RC_CONFIG_CENTER), + io_reg_get(PX4IO_PAGE_RC_CONFIG, base + PX4IO_P_RC_CONFIG_MAX), + io_reg_get(PX4IO_PAGE_RC_CONFIG, base + PX4IO_P_RC_CONFIG_DEADZONE), + io_reg_get(PX4IO_PAGE_RC_CONFIG, base + PX4IO_P_RC_CONFIG_ASSIGNMENT), + options, + ((options & PX4IO_P_RC_CONFIG_OPTIONS_ENABLED) ? " ENABLED" : ""), + ((options & PX4IO_P_RC_CONFIG_OPTIONS_REVERSE) ? " REVERSED" : "")); + } } int |