From 65d8b5c9cd107900d69a560979022507ae5cc2ea Mon Sep 17 00:00:00 2001 From: David Sidrane Date: Thu, 22 Jun 2017 05:11:16 -1000 Subject: [PATCH] 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. --- src/drivers/boards/px4fmu-v4/px4fmu_init.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/drivers/boards/px4fmu-v4/px4fmu_init.c b/src/drivers/boards/px4fmu-v4/px4fmu_init.c index 55208b33e7..f408ab74cc 100644 --- a/src/drivers/boards/px4fmu-v4/px4fmu_init.c +++ b/src/drivers/boards/px4fmu-v4/px4fmu_init.c @@ -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); + } } /************************************************************************************