X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=src%2Finput%2Ftrace32_ad.c;h=81df295a238ebf79b188720e787976f4fe41248a;hb=152e7f4d7cb4cea3d5a37752e29cb67e2a4f49b2;hp=06fc52146fd376c86f4b556d816791e91085011e;hpb=6d2897e394950bb661a27fd33dbcd14d8c56c61f;p=libsigrok.git diff --git a/src/input/trace32_ad.c b/src/input/trace32_ad.c index 06fc5214..81df295a 100644 --- a/src/input/trace32_ad.c +++ b/src/input/trace32_ad.c @@ -85,7 +85,7 @@ enum { struct context { gboolean meta_sent; - gboolean header_read, records_read; + gboolean header_read, records_read, trigger_sent; char format, device, record_mode, compression; char pod_status[MAX_POD_COUNT]; struct sr_channel *channels[MAX_POD_COUNT][17]; /* 16 + CLK */ @@ -467,13 +467,14 @@ static void process_record_pi(struct sr_input *in, gsize start) return; } - if (timestamp == inc->trigger_timestamp) { + if (timestamp == inc->trigger_timestamp && !inc->trigger_sent) { sr_dbg("Trigger @%lf s, record #%d.", timestamp * TIMESTAMP_RESOLUTION, inc->cur_record); packet.type = SR_DF_TRIGGER; packet.payload = NULL; sr_session_send(in->sdi, &packet); + inc->trigger_sent = TRUE; } /* Is this the last record in the file? */ @@ -519,13 +520,14 @@ static void process_record_iprobe(struct sr_input *in, gsize start) single_payload[2] = R8(in->buf->str + start + 10) & 1; payload_len = 3; - if (timestamp == inc->trigger_timestamp) { + if (timestamp == inc->trigger_timestamp && !inc->trigger_sent) { sr_dbg("Trigger @%lf s, record #%d.", timestamp * TIMESTAMP_RESOLUTION, inc->cur_record); packet.type = SR_DF_TRIGGER; packet.payload = NULL; sr_session_send(in->sdi, &packet); + inc->trigger_sent = TRUE; } /* Is this the last record in the file? */