From 06da94dcead3f637f8c70f57516b8992b5c817f2 Mon Sep 17 00:00:00 2001 From: night-ghost Date: Wed, 23 May 2018 13:54:11 +0500 Subject: [PATCH] HAL_F4Light: fixed non-inverted SBUS parsing --- libraries/AP_HAL_F4Light/RC_PPM_parser.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libraries/AP_HAL_F4Light/RC_PPM_parser.cpp b/libraries/AP_HAL_F4Light/RC_PPM_parser.cpp index 138f0bfac5..4cc559ba84 100644 --- a/libraries/AP_HAL_F4Light/RC_PPM_parser.cpp +++ b/libraries/AP_HAL_F4Light/RC_PPM_parser.cpp @@ -38,7 +38,7 @@ void PPM_parser::init(uint8_t ch){ last_pulse = {0,0}; _ioc = Scheduler::register_io_completion(FUNCTOR_BIND_MEMBER(&PPM_parser::parse_pulses, void)); - // TODO Panic on IOC not allocated + // TODO Panic on IOC not allocated ? // callback is called on each edge so must be as fast as possible Revo_handler h = { .mp = FUNCTOR_BIND_MEMBER(&PPM_parser::start_ioc, void) }; @@ -77,9 +77,9 @@ void PPM_parser::rxIntRC(uint16_t last_value, uint16_t value, bool state) _process_ppmsum_pulse( (last_value + value) >>1 ); // process PPM only if no protocols detected } - if((_rc_mode &~BOARD_RC_SBUS_NI) == 0){ + if((_rc_mode & ~BOARD_RC_SBUS_NI) == 0){ // test for non-inverted SBUS in 2nd memory structures - _process_sbus_pulse(last_value>>1, value>>1, sbus_state[1]); // was 1 so now is length of 1, last is a length of 0 + _process_sbus_pulse(value>>1, last_value>>1, sbus_state[1]); // was 1 so now is length of 1, last is a length of 0 } } else { // was 0 so rising