]> sigrok.org Git - libsigrok.git/commitdiff
Sigma: Only send trigger packet if enabled.
authorHåvard Espeland <redacted>
Tue, 18 Jan 2011 21:24:23 +0000 (22:24 +0100)
committerHåvard Espeland <redacted>
Tue, 18 Jan 2011 21:24:23 +0000 (22:24 +0100)
The Sigma hardware emits a default trigger event.

hardware/asix-sigma/asix-sigma.c
hardware/asix-sigma/asix-sigma.h

index bcf96422ef99f585a1a6ed8e889b176779a895c5..f356c8482fdbf3e1791378098cda179a09853faf 100644 (file)
@@ -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. */
index 0c672491df30d70b7c1f87c905800310b7ee2b62..c4f31e822775f79f2ad48c7bf3e03aac6efce136 100644 (file)
@@ -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;
 };