Ejemplo n.º 1
0
void radio_control_impl_event(void (* _received_frame_handler)(void))
{
  sbus_dual_decode_event();
  if (sbus2.frame_available) {
    radio_control.frame_cpt++;
    radio_control.time_since_last_frame = 0;
    if (radio_control.radio_ok_cpt > 0) {
      radio_control.radio_ok_cpt--;
    } else {
      radio_control.status = RC_OK;
      NormalizePpmIIR(sbus2.pulses,radio_control);
      _received_frame_handler();
    }
    sbus2.frame_available = FALSE;
  }
  if (sbus1.frame_available) {
    radio_control.frame_cpt++;
    radio_control.time_since_last_frame = 0;
    if (radio_control.radio_ok_cpt > 0) {
      radio_control.radio_ok_cpt--;
    } else {
      radio_control.status = RC_OK;
      NormalizePpmIIR(sbus1.pulses,radio_control);
      _received_frame_handler();
    }
    sbus1.frame_available = FALSE;
  }
}
Ejemplo n.º 2
0
void radio_control_impl_event(void (* _received_frame_handler)(void))
{
  if (ppm_frame_available) {
    radio_control.frame_cpt++;
    radio_control.time_since_last_frame = 0;
    if (radio_control.radio_ok_cpt > 0) {
      radio_control.radio_ok_cpt--;
    } else {
      radio_control.status = RC_OK;
      NormalizePpmIIR(ppm_pulses, radio_control);
      _received_frame_handler();
    }
    ppm_frame_available = false;
  }
}