HAL_F4Light: fixed non-inverted SBUS parsing

This commit is contained in:
night-ghost 2018-05-23 13:54:11 +05:00 committed by Andrew Tridgell
parent 6d3a879219
commit 06da94dcea

View File

@ -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