]> sigrok.org Git - libsigrok.git/blobdiff - src/hardware/dreamsourcelab-dslogic/protocol.c
dreamsourcelab-dslogic: Fixed trigger-stages field in trig_glb
[libsigrok.git] / src / hardware / dreamsourcelab-dslogic / protocol.c
index efb626dc45ea024e569996a5393a7afc2091dc4c..42722f435977722d7579abcd53ec1c7f11294b9a 100644 (file)
@@ -354,23 +354,7 @@ static void set_trigger(const struct sr_dev_inst *sdi, struct fpga_config *cfg)
 
        cfg->ch_en = enabled_channel_mask(sdi);
 
-       cfg->trig_mask0[0] = 0xffff;
-       cfg->trig_mask1[0] = 0xffff;
-
-       cfg->trig_value0[0] = 0;
-       cfg->trig_value1[0] = 0;
-
-       cfg->trig_edge0[0] = 0;
-       cfg->trig_edge1[0] = 0;
-
-       cfg->trig_logic0[0] = 2;
-       cfg->trig_logic1[0] = 2;
-
-       cfg->trig_count[0] = 0;
-
-       cfg->trig_glb = num_enabled_channels << 4;
-
-       for (i = 1; i < NUM_TRIGGER_STAGES; i++) {
+       for (i = 0; i < NUM_TRIGGER_STAGES; i++) {
                cfg->trig_mask0[i] = 0xffff;
                cfg->trig_mask1[i] = 0xffff;
                cfg->trig_value0[i] = 0;
@@ -434,7 +418,7 @@ static void set_trigger(const struct sr_dev_inst *sdi, struct fpga_config *cfg)
                }
        }
 
-       cfg->trig_glb |= num_trigger_stages;
+       cfg->trig_glb = (num_enabled_channels << 4) | (num_trigger_stages - 1);
 }
 
 static int fpga_configure(const struct sr_dev_inst *sdi)