If one device is failing it should not affect the transfers of other devices.
Signed-off-by: Lars-Peter Clausen <[email protected]> --- libsigrok/hardware/fx2lafw/fx2lafw.c | 9 ++++----- libsigrok/hardware/fx2lafw/fx2lafw.h | 1 + 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/libsigrok/hardware/fx2lafw/fx2lafw.c b/libsigrok/hardware/fx2lafw/fx2lafw.c index 64d16b7..e44c276 100644 --- a/libsigrok/hardware/fx2lafw/fx2lafw.c +++ b/libsigrok/hardware/fx2lafw/fx2lafw.c @@ -696,8 +696,6 @@ static void resubmit_transfer(struct libusb_transfer *transfer) static void receive_transfer(struct libusb_transfer *transfer) { - /* TODO: These statics have to move to the ctx struct. */ - static int empty_transfer_count = 0; gboolean packet_has_error = FALSE; struct sr_datafeed_packet packet; struct sr_datafeed_logic logic; @@ -735,8 +733,8 @@ static void receive_transfer(struct libusb_transfer *transfer) } if (transfer->actual_length == 0 || packet_has_error) { - empty_transfer_count++; - if (empty_transfer_count > MAX_EMPTY_TRANSFERS) { + ctx->empty_transfer_count++; + if (ctx->empty_transfer_count > MAX_EMPTY_TRANSFERS) { /* * The FX2 gave up. End the acquisition, the frontend * will work out that the samplecount is short. @@ -748,7 +746,7 @@ static void receive_transfer(struct libusb_transfer *transfer) } return; } else { - empty_transfer_count = 0; + ctx->empty_transfer_count = 0; } trigger_offset = 0; @@ -890,6 +888,7 @@ static int hw_dev_acquisition_start(int dev_index, void *cb_data) ctx = sdi->priv; ctx->session_dev_id = cb_data; ctx->num_samples = 0; + ctx->empty_transfer_count = 0; const unsigned int timeout = get_timeout(ctx); const unsigned int num_transfers = get_number_of_transfers(ctx); diff --git a/libsigrok/hardware/fx2lafw/fx2lafw.h b/libsigrok/hardware/fx2lafw/fx2lafw.h index c6ad3ce..727c0fa 100644 --- a/libsigrok/hardware/fx2lafw/fx2lafw.h +++ b/libsigrok/hardware/fx2lafw/fx2lafw.h @@ -84,6 +84,7 @@ struct context { int num_samples; int submitted_transfers; + int empty_transfer_count; void *session_dev_id; -- 1.7.10 ------------------------------------------------------------------------------ Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ _______________________________________________ sigrok-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/sigrok-devel

