@ -56,7 +56,13 @@ void AP_RCProtocol::process_pulse(uint32_t width_s0, uint32_t width_s1)
@@ -56,7 +56,13 @@ void AP_RCProtocol::process_pulse(uint32_t width_s0, uint32_t width_s1)
}
// otherwise scan all protocols
for ( uint8_t i = 0 ; i < AP_RCProtocol : : NONE ; i + + ) {
rcprotocol_t last_protocol = AP_RCProtocol : : NONE ;
# ifdef HAL_RCIN_PULSE_PPM_ONLY
// only uses pulses for PPM on this board, using process_byte() for
// other protocols
last_protocol = ( rcprotocol_t ) 1 ;
# endif
for ( uint8_t i = 0 ; i < last_protocol ; i + + ) {
if ( backend [ i ] ! = nullptr ) {
backend [ i ] - > process_pulse ( width_s0 , width_s1 ) ;
if ( backend [ i ] - > new_input ( ) ) {
@ -69,7 +75,7 @@ void AP_RCProtocol::process_pulse(uint32_t width_s0, uint32_t width_s1)
@@ -69,7 +75,7 @@ void AP_RCProtocol::process_pulse(uint32_t width_s0, uint32_t width_s1)
}
}
void AP_RCProtocol : : process_byte ( uint8_t byte )
void AP_RCProtocol : : process_byte ( uint8_t byte , uint32_t baudrate )
{
if ( _detected_protocol ! = AP_RCProtocol : : NONE & & ! _detected_with_bytes ) {
// we're using pulse inputs, discard bytes
@ -78,7 +84,7 @@ void AP_RCProtocol::process_byte(uint8_t byte)
@@ -78,7 +84,7 @@ void AP_RCProtocol::process_byte(uint8_t byte)
uint32_t now = AP_HAL : : millis ( ) ;
// first try current protocol
if ( _detected_protocol ! = AP_RCProtocol : : NONE & & now - _last_input_ms < 200 ) {
backend [ _detected_protocol ] - > process_byte ( byte ) ;
backend [ _detected_protocol ] - > process_byte ( byte , baudrate ) ;
if ( backend [ _detected_protocol ] - > new_input ( ) ) {
_new_input = true ;
_last_input_ms = AP_HAL : : millis ( ) ;
@ -89,7 +95,7 @@ void AP_RCProtocol::process_byte(uint8_t byte)
@@ -89,7 +95,7 @@ void AP_RCProtocol::process_byte(uint8_t byte)
// otherwise scan all protocols
for ( uint8_t i = 0 ; i < AP_RCProtocol : : NONE ; i + + ) {
if ( backend [ i ] ! = nullptr ) {
backend [ i ] - > process_byte ( byte ) ;
backend [ i ] - > process_byte ( byte , baudrate ) ;
if ( backend [ i ] - > new_input ( ) ) {
_new_input = true ;
_detected_protocol = ( enum AP_RCProtocol : : rcprotocol_t ) i ;