Skip to content

Commit 1a3c627

Browse files
committed
protocol: Fix condition (wait for trigger) for sample acquisition in receive_transfer function
1 parent 2862ac8 commit 1a3c627

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/hardware/sipeed-slogic-analyzer/protocol.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ static void LIBUSB_CALL receive_transfer(struct libusb_transfer *transfer)
9999
g_async_queue_push(devc->raw_data_queue, array);
100100
}
101101

102-
if (devc->samples_got_nbytes +
102+
if (!devc->trigger_fired || devc->samples_got_nbytes +
103103
devc->num_transfers_used *
104104
devc->per_transfer_nbytes <
105105
devc->samples_need_nbytes) {
@@ -126,7 +126,7 @@ static void LIBUSB_CALL receive_transfer(struct libusb_transfer *transfer)
126126
break;
127127
}
128128

129-
if (devc->num_transfers_completed &&
129+
if (devc->trigger_fired && devc->num_transfers_completed &&
130130
(double)transfers_reached_duration / SR_KHZ(1) >
131131
(TRANSFERS_DURATION_TOLERANCE + 1) *
132132
devc->per_transfer_duration) {

0 commit comments

Comments
 (0)