Browse Source

HAL_F4Light: fixed non-inverted SBUS parsing

mission-4.1.18
night-ghost 7 years ago committed by Andrew Tridgell
parent
commit
06da94dcea
  1. 4
      libraries/AP_HAL_F4Light/RC_PPM_parser.cpp

4
libraries/AP_HAL_F4Light/RC_PPM_parser.cpp

@ -38,7 +38,7 @@ void PPM_parser::init(uint8_t ch){ @@ -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) };
@ -79,7 +79,7 @@ void PPM_parser::rxIntRC(uint16_t last_value, uint16_t value, bool state) @@ -79,7 +79,7 @@ void PPM_parser::rxIntRC(uint16_t last_value, uint16_t value, bool state)
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

Loading…
Cancel
Save