File 0007-protocol-Fix-condition-wait-for-trigger-for-sample-a.patch of Package libsigrok
From fefb44f53dc9fba7a206bc2d6cf669a0cce5cc94 Mon Sep 17 00:00:00 2001
From: taorye <taorye@outlook.com>
Date: Mon, 8 Dec 2025 10:23:45 +0800
Subject: [PATCH 07/17] protocol: Fix condition (wait for trigger) for sample
acquisition in receive_transfer function
---
src/hardware/sipeed-slogic-analyzer/protocol.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/hardware/sipeed-slogic-analyzer/protocol.c b/src/hardware/sipeed-slogic-analyzer/protocol.c
index de3f9c4b0..4f3979172 100644
--- a/src/hardware/sipeed-slogic-analyzer/protocol.c
+++ b/src/hardware/sipeed-slogic-analyzer/protocol.c
@@ -99,7 +99,7 @@ static void LIBUSB_CALL receive_transfer(struct libusb_transfer *transfer)
g_async_queue_push(devc->raw_data_queue, array);
}
- if (devc->samples_got_nbytes +
+ if (!devc->trigger_fired || devc->samples_got_nbytes +
devc->num_transfers_used *
devc->per_transfer_nbytes <
devc->samples_need_nbytes) {
@@ -126,7 +126,7 @@ static void LIBUSB_CALL receive_transfer(struct libusb_transfer *transfer)
break;
}
- if (devc->num_transfers_completed &&
+ if (devc->trigger_fired && devc->num_transfers_completed &&
(double)transfers_reached_duration / SR_KHZ(1) >
(TRANSFERS_DURATION_TOLERANCE + 1) *
devc->per_transfer_duration) {
--
2.52.0