Hello,

a topic from the IRC


there are 3 Files as patch (hex.c, ascii.c and bits.c)

This files control the triggerpositon with the marker ^.


I change the value, define as "offset", of spaces before the
triggermarker ^ . 

change the counter start point from '0' to "1".

Bitposition like
1 2 3 4 5 6 7 8  9 10 11 .....

thanks gsi


after the patch picture
hex output:
https://pasteboard.co/HqENWgkW.png
bits output:
https://pasteboard.co/HqEP2qe.png
ascii output:
https://pasteboard.co/HqEPzOq.png



The problem is I can see the bug only with LA dslogic (hw-trigger often
with offset!=0) not  saleae/saleae16-clones (sw-trigger every/often
offset==0).
To check this patch you need a LA with "offset" much more then ~ 15.

Not zero. 


a picture from IRC before patch install
https://pasteboard.co/HqDRY9H.png

with the bug.





best regards

Jörg

diff --git a/org/ascii.c b/new/ascii.c
index d0d40b6..4dbde64 100644
--- a/org/ascii.c
+++ b/new/ascii.c
@@ -199,8 +199,8 @@ static int receive(const struct sr_output *o, const struct sr_datafeed_packet *p
 					g_string_append_len(*out, ctx->lines[j]->str, ctx->lines[j]->len);
 					g_string_append_c(*out, '\n');
 					if (j == ctx->num_enabled_channels - 1 && ctx->trigger > -1) {
-						offset = ctx->trigger + ctx->trigger / 8;
-						g_string_append_printf(*out, "T:%*s^ %d\n", offset, "", ctx->trigger);
+						offset = ctx->trigger;
+						g_string_append_printf(*out, "T:%*s^ %d\n", offset, "", ctx->trigger + 1);
 						ctx->trigger = -1;
 					}
 					g_string_printf(ctx->lines[j], "%s:", ctx->channel_names[j]);
diff --git a/org/bits.c b/new/bits.c
index 768a985..5d7528f 100644
--- a/org/bits.c
+++ b/new/bits.c
@@ -169,7 +169,7 @@ static int receive(const struct sr_output *o, const struct sr_datafeed_packet *p
 					g_string_append_c(*out, '\n');
 					if (j == ctx->num_enabled_channels - 1 && ctx->trigger > -1) {
 						offset = ctx->trigger + ctx->trigger / 8;
-						g_string_append_printf(*out, "T:%*s^ %d\n", offset, "", ctx->trigger);
+						g_string_append_printf(*out, "T:%*s^ %d\n", offset, "", ctx->trigger + 1);
 						ctx->trigger = -1;
 					}
 					g_string_printf(ctx->lines[j], "%s:", ctx->channel_names[j]);
diff --git a/org/hex.c b/new/hex.c
index 8fcfcea..9a8f873 100644
--- a/org/hex.c
+++ b/new/hex.c
@@ -181,8 +181,8 @@ static int receive(const struct sr_output *o, const struct sr_datafeed_packet *p
 					g_string_append_len(*out, ctx->lines[j]->str, ctx->lines[j]->len);
 					g_string_append_c(*out, '\n');
 					if (j == ctx->num_enabled_channels - 1 && ctx->trigger > -1) {
-						offset = ctx->trigger + ctx->trigger / 8;
-						g_string_append_printf(*out, "T:%*s^ %d\n", offset, "", ctx->trigger);
+						offset = ctx->trigger / 4 + ctx->trigger / 8;
+						g_string_append_printf(*out, "T:%*s^ %d\n", offset, "", ctx->trigger + 1);
 						ctx->trigger = -1;
 					}
 					g_string_printf(ctx->lines[j], "%s:", ctx->channel_names[j]);
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
sigrok-devel mailing list
sigrok-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sigrok-devel

Reply via email to