X-Git-Url: http://sigrok.org/gitweb/?a=blobdiff_plain;f=src%2Fhardware%2Ffx2lafw%2Fprotocol.c;h=8854f5a69afd7221931b606b6d0c24a6001426c9;hb=ecd4600bb15fc16d842936c452d4e7d5fb8e12f5;hp=ef41f221a40ac16503f10b18ffb68aa45b0db6db;hpb=bfc34b9ab0302fa0ba98eef3ce1b35c76d378589;p=libsigrok.git diff --git a/src/hardware/fx2lafw/protocol.c b/src/hardware/fx2lafw/protocol.c index ef41f221..8854f5a6 100644 --- a/src/hardware/fx2lafw/protocol.c +++ b/src/hardware/fx2lafw/protocol.c @@ -255,11 +255,14 @@ SR_PRIV struct dev_context *fx2lafw_dev_new(void) devc = g_malloc0(sizeof(struct dev_context)); devc->profile = NULL; + devc->channel_names = NULL; devc->fw_updated = 0; devc->cur_samplerate = 0; + devc->limit_frames = 1; devc->limit_samples = 0; devc->capture_ratio = 0; devc->sample_wide = FALSE; + devc->num_frames = 0; devc->stl = NULL; return devc; @@ -506,6 +509,7 @@ check_trigger: const int frame_ended = devc->limit_samples && (devc->sent_samples >= devc->limit_samples); const int final_frame = devc->limit_frames && (devc->num_frames >= (devc->limit_frames - 1)); + if (frame_ended) { devc->num_frames++; devc->sent_samples = 0; @@ -718,6 +722,7 @@ SR_PRIV int fx2lafw_start_acquisition(const struct sr_dev_inst *sdi) devc = sdi->priv; devc->ctx = drvc->sr_ctx; + devc->num_frames = 0; devc->sent_samples = 0; devc->empty_transfer_count = 0; devc->acq_aborted = FALSE;