px4fmu-v4:Insure the discharge of the pins PWM pins on rest.

On resets invoked from system (not boot) insure we establish a low
  output state (discharge the pins) on PWM pins before they become
  inputs.
This commit is contained in:
David Sidrane 2017-06-22 05:11:16 -10:00 committed by Lorenz Meier
parent 38fa6dcad5
commit 65d8b5c9cd

View File

@ -165,14 +165,22 @@ __EXPORT void board_peripheral_reset(int ms)
************************************************************************************/
__EXPORT void board_on_reset(int status)
{
UNUSED(status);
/* configure the GPIO pins to outputs and keep them low */
stm32_configgpio(GPIO_GPIO0_OUTPUT);
stm32_configgpio(GPIO_GPIO1_OUTPUT);
stm32_configgpio(GPIO_GPIO2_OUTPUT);
stm32_configgpio(GPIO_GPIO3_OUTPUT);
stm32_configgpio(GPIO_GPIO4_OUTPUT);
stm32_configgpio(GPIO_GPIO5_OUTPUT);
/* On resets invoked from system (not boot) insure we establish a low
* output state (discharge the pins) on PWM pins before they become inputs.
*/
if (status >= 0) {
up_mdelay(6);
}
}
/************************************************************************************