diff options
author | Lorenz Meier <lm@inf.ethz.ch> | 2013-08-14 12:43:59 -0700 |
---|---|---|
committer | Lorenz Meier <lm@inf.ethz.ch> | 2013-08-14 12:43:59 -0700 |
commit | d2f19c7d84030ad6ed1f6c17538fa96864c5dcef (patch) | |
tree | 956e3dfbe673c69beef60820d4ebe6e8b988f569 /src/modules | |
parent | 01d354effc9f49ce7b0d1ec082f207c8d4793789 (diff) | |
parent | 0b935550439a17856f5218fdcd6be8b864cfd346 (diff) | |
download | px4-firmware-d2f19c7d84030ad6ed1f6c17538fa96864c5dcef.tar.gz px4-firmware-d2f19c7d84030ad6ed1f6c17538fa96864c5dcef.tar.bz2 px4-firmware-d2f19c7d84030ad6ed1f6c17538fa96864c5dcef.zip |
Merge pull request #354 from jean-m-cyr/master
Support initiating DSM bind via QGroundControl
Diffstat (limited to 'src/modules')
-rw-r--r-- | src/modules/px4iofirmware/dsm.c | 4 | ||||
-rw-r--r-- | src/modules/sensors/sensor_params.c | 1 | ||||
-rw-r--r-- | src/modules/sensors/sensors.cpp | 12 |
3 files changed, 3 insertions, 14 deletions
diff --git a/src/modules/px4iofirmware/dsm.c b/src/modules/px4iofirmware/dsm.c index ab6e3fec4..b2c0db425 100644 --- a/src/modules/px4iofirmware/dsm.c +++ b/src/modules/px4iofirmware/dsm.c @@ -125,9 +125,9 @@ dsm_bind(uint16_t cmd, int pulses) case dsm_bind_send_pulses: for (int i = 0; i < pulses; i++) { stm32_gpiowrite(usart1RxAsOutp, false); - up_udelay(50); + up_udelay(25); stm32_gpiowrite(usart1RxAsOutp, true); - up_udelay(50); + up_udelay(25); } break; case dsm_bind_reinit_uart: diff --git a/src/modules/sensors/sensor_params.c b/src/modules/sensors/sensor_params.c index 133cda8d6..bd431c9eb 100644 --- a/src/modules/sensors/sensor_params.c +++ b/src/modules/sensors/sensor_params.c @@ -156,6 +156,7 @@ PARAM_DEFINE_FLOAT(RC14_DZ, 0.0f); PARAM_DEFINE_INT32(RC_TYPE, 1); /** 1 = FUTABA, 2 = Spektrum, 3 = Graupner HoTT, 4 = Turnigy 9x */ PARAM_DEFINE_INT32(RC_RL1_DSM_VCC, 0); /* Relay 1 controls DSM VCC */ +PARAM_DEFINE_INT32(RC_DSM_BIND, 0); /* 0 = Idle, 1 = Start DSM2 bind, 2 = Start DSMX bind */ /* default is conversion factor for the PX4IO / PX4IOAR board, the factor for PX4FMU standalone is different */ PARAM_DEFINE_FLOAT(BAT_V_SCALING, (3.3f * 52.0f / 5.0f / 4095.0f)); diff --git a/src/modules/sensors/sensors.cpp b/src/modules/sensors/sensors.cpp index f7b41b120..42268b971 100644 --- a/src/modules/sensors/sensors.cpp +++ b/src/modules/sensors/sensors.cpp @@ -257,8 +257,6 @@ private: float battery_voltage_scaling; - int rc_rl1_DSM_VCC_control; - } _parameters; /**< local copies of interesting parameters */ struct { @@ -308,8 +306,6 @@ private: param_t battery_voltage_scaling; - param_t rc_rl1_DSM_VCC_control; - } _parameter_handles; /**< handles for interesting parameters */ @@ -544,9 +540,6 @@ Sensors::Sensors() : _parameter_handles.battery_voltage_scaling = param_find("BAT_V_SCALING"); - /* DSM VCC relay control */ - _parameter_handles.rc_rl1_DSM_VCC_control = param_find("RC_RL1_DSM_VCC"); - /* fetch initial parameter values */ parameters_update(); } @@ -738,11 +731,6 @@ Sensors::parameters_update() warnx("Failed updating voltage scaling param"); } - /* relay 1 DSM VCC control */ - if (param_get(_parameter_handles.rc_rl1_DSM_VCC_control, &(_parameters.rc_rl1_DSM_VCC_control)) != OK) { - warnx("Failed updating relay 1 DSM VCC control"); - } - return OK; } |