Commit 1bb01f9b authored by Wenxi Xu's avatar Wenxi Xu
Browse files

Fix sbus driver

parent debf33a7
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -110,9 +110,12 @@ static void uart_callback(const struct device *dev, struct uart_event *evt, void
		uint16_t len = evt->data.rx.len;

		uint8_t *ptr_offset = p + find_begin(p, len);
		if (ptr_offset >= p && ptr_offset + 25 < p + len) {
		if (ptr_offset >= p && ptr_offset + 25 <= p + len) {
			memcpy(data->data, ptr_offset, 25);
		} else {
			return;
		}

		data->recv_cyc = k_cycle_get_32();
		break;
	}