From: HÃ¥vard Espeland Date: Tue, 18 Jan 2011 21:24:23 +0000 (+0100) Subject: Sigma: Only send trigger packet if enabled. X-Git-Tag: libsigrok-0.1.0~410 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=5b5ea7c6d25bb42de09b61d0a070d78252f2367b;p=libsigrok.git Sigma: Only send trigger packet if enabled. The Sigma hardware emits a default trigger event. --- diff --git a/hardware/asix-sigma/asix-sigma.c b/hardware/asix-sigma/asix-sigma.c index bcf96422..f356c848 100644 --- a/hardware/asix-sigma/asix-sigma.c +++ b/hardware/asix-sigma/asix-sigma.c @@ -407,6 +407,7 @@ static int hw_init(char *deviceinfo) sigma->num_probes = 0; sigma->samples_per_event = 0; sigma->capture_ratio = 50; + sigma->use_triggers = 0; /* Register SIGMA device. */ sdi = sigrok_device_instance_new(0, ST_INITIALIZING, @@ -654,6 +655,9 @@ static int configure_probes(struct sigrok_device_instance *sdi, GSList *probes) return SIGROK_ERR; } } + + if (trigger_set) + sigma->use_triggers = 1; } return SIGROK_OK; @@ -913,10 +917,13 @@ static int decode_chunk_ts(uint8_t *buf, uint16_t *lastts, sent += tosend; } - packet.type = DF_TRIGGER; - packet.length = 0; - packet.payload = 0; - session_bus(sigma->session_id, &packet); + /* Only send trigger if explicitly enabled. */ + if (sigma->use_triggers) { + packet.type = DF_TRIGGER; + packet.length = 0; + packet.payload = 0; + session_bus(sigma->session_id, &packet); + } } /* Send rest of the chunk to sigrok. */ diff --git a/hardware/asix-sigma/asix-sigma.h b/hardware/asix-sigma/asix-sigma.h index 0c672491..c4f31e82 100644 --- a/hardware/asix-sigma/asix-sigma.h +++ b/hardware/asix-sigma/asix-sigma.h @@ -183,6 +183,7 @@ struct sigma { int samples_per_event; int capture_ratio; struct sigma_trigger trigger; + int use_triggers; struct sigma_state state; gpointer session_id; };