mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-27 14:33:34 +08:00
handle PPM input with RC_SERIAL_PORT undefined
This commit is contained in:
committed by
Lorenz Meier
parent
72156d9cd6
commit
ca2e9e7be1
@@ -939,7 +939,7 @@ PX4FMU::cycle()
|
|||||||
// This triggers the port re-configuration
|
// This triggers the port re-configuration
|
||||||
rc_scan_begin = 0;
|
rc_scan_begin = 0;
|
||||||
// Scan the next protocol
|
// Scan the next protocol
|
||||||
rc_scan_state = RC_SCAN_PPM;
|
rc_scan_state = RC_SCAN_ST24;
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
@@ -980,15 +980,18 @@ PX4FMU::cycle()
|
|||||||
// This triggers the port re-configuration
|
// This triggers the port re-configuration
|
||||||
rc_scan_begin = 0;
|
rc_scan_begin = 0;
|
||||||
// Scan the next protocol
|
// Scan the next protocol
|
||||||
rc_scan_state = RC_SCAN_PPM;
|
rc_scan_state = RC_SCAN_SUMD;
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case RC_SCAN_SUMD:
|
case RC_SCAN_SUMD:
|
||||||
|
rc_scan_state = RC_SCAN_PPM;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case RC_SCAN_PPM:
|
case RC_SCAN_PPM:
|
||||||
|
// skip PPM if it's not supported
|
||||||
|
#ifdef HRT_PPM_CHANNEL
|
||||||
if (rc_scan_begin == 0) {
|
if (rc_scan_begin == 0) {
|
||||||
rc_scan_begin = now;
|
rc_scan_begin = now;
|
||||||
// Configure timer input pin for CPPM
|
// Configure timer input pin for CPPM
|
||||||
@@ -1017,10 +1020,28 @@ PX4FMU::cycle()
|
|||||||
rc_scan_state = RC_SCAN_SBUS;
|
rc_scan_state = RC_SCAN_SBUS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#else // skip PPM if it's not supported
|
||||||
|
rc_scan_state = RC_SCAN_SBUS;
|
||||||
|
|
||||||
|
#endif // HRT_PPM_CHANNEL
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#else // RC_SERIAL_PORT not defined
|
||||||
|
#ifdef HRT_PPM_CHANNEL
|
||||||
|
|
||||||
|
// see if we have new PPM input data
|
||||||
|
if ((ppm_last_valid_decode != _rc_in.timestamp_last_signal)
|
||||||
|
&& ppm_decoded_channels > 3) {
|
||||||
|
// we have a new PPM frame. Publish it.
|
||||||
|
rc_updated = true;
|
||||||
|
fill_rc_in(ppm_decoded_channels, ppm_buffer, hrt_absolute_time(),
|
||||||
|
false, false, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif // HRT_PPM_CHANNEL
|
||||||
|
#endif // RC_SERIAL_PORT
|
||||||
|
|
||||||
if (rc_updated) {
|
if (rc_updated) {
|
||||||
/* lazily advertise on first publication */
|
/* lazily advertise on first publication */
|
||||||
|
|||||||
Reference in New Issue
Block a user