mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-04-14 10:07:39 +08:00
move PPM input disable into scan case for PPM; PPM input is now enabled only while in RC_SCAN_PPM state
This commit is contained in:
parent
434ce85937
commit
71a3e3713c
@ -673,6 +673,8 @@ PX4FMU::cycle()
|
||||
_rcs_fd = :: open(RC_SERIAL_PORT, O_RDWR | O_NONBLOCK);
|
||||
// assume SBUS input
|
||||
sbus_config(_rcs_fd, false);
|
||||
// disable CPPM input by mapping it away from the timer capture input
|
||||
stm32_configgpio(GPIO_PPM_IN & ~(GPIO_AF_MASK | GPIO_PUPD_MASK));
|
||||
#endif
|
||||
_initialized = true;
|
||||
}
|
||||
@ -866,12 +868,6 @@ PX4FMU::cycle()
|
||||
if (report_lock && rc_scan_locked) {
|
||||
report_lock = false;
|
||||
warnx("fmu: RC input %u locked", rc_scan_state);
|
||||
|
||||
if (rc_scan_state != RC_SCAN_PPM) {
|
||||
warnx("fmu: disabling PPM input");
|
||||
// disable CPPM input by mapping it away from the timer capture input
|
||||
stm32_configgpio(GPIO_PPM_IN & ~GPIO_AF_MASK);
|
||||
}
|
||||
}
|
||||
|
||||
// read all available data from the serial RC input UART
|
||||
@ -1018,6 +1014,8 @@ PX4FMU::cycle()
|
||||
} else if (!rc_scan_locked) {
|
||||
// This triggers the port re-configuration
|
||||
rc_scan_begin = 0;
|
||||
// disable CPPM input by mapping it away from the timer capture input
|
||||
stm32_configgpio(GPIO_PPM_IN & ~(GPIO_AF_MASK | GPIO_PUPD_MASK));
|
||||
// Scan the next protocol
|
||||
rc_scan_state = RC_SCAN_SBUS;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user