From ac3bc34d15af5612c933ef307ce0d6e5272dc14b Mon Sep 17 00:00:00 2001 From: Lorenz Meier Date: Sat, 5 Dec 2015 15:30:23 +0100 Subject: [PATCH] S.BUS decoder: Do not report initial sync as dropped frame --- src/lib/rc/sbus.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/lib/rc/sbus.c b/src/lib/rc/sbus.c index e3d63e0606..84cac34185 100644 --- a/src/lib/rc/sbus.c +++ b/src/lib/rc/sbus.c @@ -134,6 +134,7 @@ sbus_init(const char *device, bool singlewire) /* initialise the decoder */ partial_frame_count = 0; last_rx_time = hrt_absolute_time(); + last_frame_time = last_rx_time; sbus_frame_drops = 0; } @@ -226,7 +227,7 @@ sbus_input(int sbus_fd, uint16_t *values, uint16_t *num_values, bool *sbus_fails } } - if (rc_control_packet) { + if (rc_control_packet && last_frame_time > 0) { /* we should not be reading anything in this state if synced */ sbus_frame_drops++; }