unconfigure GPIO_PPM_IN before reconfiguring

This commit is contained in:
Mark Whitehorn
2016-03-20 09:28:29 -06:00
committed by Julian Oes
parent 2cf5fb8fb0
commit 192c2a32c8

View File

@@ -901,6 +901,7 @@ PX4FMU::cycle()
// assume SBUS input // assume SBUS input
sbus_config(_rcs_fd, false); sbus_config(_rcs_fd, false);
// disable CPPM input by mapping it away from the timer capture input // disable CPPM input by mapping it away from the timer capture input
stm32_unconfiggpio(GPIO_PPM_IN);
stm32_configgpio(GPIO_PPM_IN & ~(GPIO_AF_MASK | GPIO_PUPD_MASK)); stm32_configgpio(GPIO_PPM_IN & ~(GPIO_AF_MASK | GPIO_PUPD_MASK));
#endif #endif
@@ -1331,6 +1332,7 @@ PX4FMU::cycle()
} else { } else {
// disable CPPM input by mapping it away from the timer capture input // disable CPPM input by mapping it away from the timer capture input
stm32_unconfiggpio(GPIO_PPM_IN);
stm32_configgpio(GPIO_PPM_IN & ~(GPIO_AF_MASK | GPIO_PUPD_MASK)); stm32_configgpio(GPIO_PPM_IN & ~(GPIO_AF_MASK | GPIO_PUPD_MASK));
// Scan the next protocol // Scan the next protocol
set_rc_scan_state(RC_SCAN_SBUS); set_rc_scan_state(RC_SCAN_SBUS);