diff options
author | px4dev <px4@purgatory.org> | 2013-01-26 19:43:23 -0800 |
---|---|---|
committer | px4dev <px4@purgatory.org> | 2013-01-26 19:43:23 -0800 |
commit | 6d0363faff7f5a59264198f04bae6f5b61c54510 (patch) | |
tree | a40d3a96067c188104ecc835dbceccdd377a2209 /apps/drivers/px4io/px4io.cpp | |
parent | 981477c7856c5d7694561e0a13ebb0747518370e (diff) | |
download | px4-firmware-6d0363faff7f5a59264198f04bae6f5b61c54510.tar.gz px4-firmware-6d0363faff7f5a59264198f04bae6f5b61c54510.tar.bz2 px4-firmware-6d0363faff7f5a59264198f04bae6f5b61c54510.zip |
Disarm IO at driver startup time.
Diffstat (limited to 'apps/drivers/px4io/px4io.cpp')
-rw-r--r-- | apps/drivers/px4io/px4io.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/apps/drivers/px4io/px4io.cpp b/apps/drivers/px4io/px4io.cpp index e48c84774..f948fec2c 100644 --- a/apps/drivers/px4io/px4io.cpp +++ b/apps/drivers/px4io/px4io.cpp @@ -308,6 +308,12 @@ PX4IO::init() if (ret != OK) return ret; + /* + * Enable a couple of retries for operations to IO. + * + * Register read/write operations are intentionally idempotent + * so this is safe as designed. + */ _retries = 2; /* get some parameters */ @@ -326,6 +332,12 @@ PX4IO::init() if (_max_rc_input > RC_INPUT_MAX_CHANNELS) _max_rc_input = RC_INPUT_MAX_CHANNELS; + /* dis-arm IO before touching anything */ + io_reg_modify(PX4IO_PAGE_SETUP, PX4IO_P_SETUP_ARMING, + PX4IO_P_SETUP_ARMING_ARM_OK | + PX4IO_P_SETUP_ARMING_MANUAL_OVERRIDE | + PX4IO_P_SETUP_ARMING_VECTOR_FLIGHT_OK, 0); + /* publish RC config to IO */ ret = io_set_rc_config(); if (ret != OK) { |