]> sigrok.org Git - libsigrok.git/commitdiff
hantek-4032l: Fix broken triggering on low signal.
authorUwe Hermann <redacted>
Sat, 6 Jul 2019 21:22:47 +0000 (23:22 +0200)
committerUwe Hermann <redacted>
Sat, 6 Jul 2019 21:22:47 +0000 (23:22 +0200)
The trigger range/mask "compression" procedure is apparently not
required and breaks triggering on a low line state.

This has been verified to fix the issue on a Hantek 4032L with FPGA
version 0x4303. It is possible that the procedure mentioned above
might be required for other FPGA versions, though that is unknown.

If you experience trigger issues with other FPGA versions, please
contact us for further debugging and testing.

This fixes bug #1402.

src/hardware/hantek-4032l/api.c

index 3dc54ba5967a446dcd4f932e96cc93476b971d4e..26a9315e5035024c9559f679a950576a72246b95 100644 (file)
@@ -587,25 +587,9 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi)
                        channel = channel->next;
                }
 
-               /* Compress range mask value and apply range settings. */
-               if (range_mask) {
-                       cmd_pkt->trigger[0].flags.data_range_enabled = 1;
-                       cmd_pkt->trigger[0].data_range_mask |= range_mask;
-
-                       uint32_t new_range_value = 0;
-                       uint32_t bit_mask = 1;
-                       while (range_mask) {
-                               if ((range_mask & 1) != 0) {
-                                       new_range_value <<= 1;
-                                       if ((range_value & 1) != 0)
-                                               new_range_value |= bit_mask;
-                                       bit_mask <<= 1;
-                               }
-                               range_mask >>= 1;
-                               range_value >>= 1;
-                       }
-                       cmd_pkt->trigger[0].data_range_max |= range_value;
-               }
+               cmd_pkt->trigger[0].flags.data_range_enabled = 1;
+               cmd_pkt->trigger[0].data_range_mask |= range_mask;
+               cmd_pkt->trigger[0].data_range_max = range_value;
        }
 
        usb_source_add(sdi->session, drvc->sr_ctx, 1000,