|
|
|
@ -88,6 +88,7 @@ sbus_init(const char *device)
@@ -88,6 +88,7 @@ sbus_init(const char *device)
|
|
|
|
|
last_rx_time = hrt_absolute_time(); |
|
|
|
|
|
|
|
|
|
debug("S.Bus: ready"); |
|
|
|
|
|
|
|
|
|
} else { |
|
|
|
|
debug("S.Bus: open failed"); |
|
|
|
|
} |
|
|
|
@ -117,6 +118,7 @@ sbus_input(void)
@@ -117,6 +118,7 @@ sbus_input(void)
|
|
|
|
|
* if we didn't drop bytes... |
|
|
|
|
*/ |
|
|
|
|
now = hrt_absolute_time(); |
|
|
|
|
|
|
|
|
|
if ((now - last_rx_time) > 3000) { |
|
|
|
|
if (partial_frame_count > 0) { |
|
|
|
|
sbus_frame_drops++; |
|
|
|
@ -133,6 +135,7 @@ sbus_input(void)
@@ -133,6 +135,7 @@ sbus_input(void)
|
|
|
|
|
/* if the read failed for any reason, just give up here */ |
|
|
|
|
if (ret < 1) |
|
|
|
|
goto out; |
|
|
|
|
|
|
|
|
|
last_rx_time = now; |
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
@ -236,6 +239,7 @@ sbus_decode(hrt_abstime frame_time)
@@ -236,6 +239,7 @@ sbus_decode(hrt_abstime frame_time)
|
|
|
|
|
value |= piece; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/* convert 0-2048 values to 1000-2000 ppm encoding in a very sloppy fashion */ |
|
|
|
|
system_state.rc_channel_data[channel] = (value / 2) + 998; |
|
|
|
|
} |
|
|
|
|