Commit 88b75eb719 ("fx2lafw: Added device caps and added support for wide
sampling") increased the size of the trigger buffer from 8 to 16 bit, but forgot
to adjust the unitsize logic packet which is used to send the contents of the
trigger buffer. This patch sets the unitsize to sizeof() of the trigger buffer.

Signed-off-by: Lars-Peter Clausen <[email protected]>
---
 libsigrok/hardware/fx2lafw/fx2lafw.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libsigrok/hardware/fx2lafw/fx2lafw.c 
b/libsigrok/hardware/fx2lafw/fx2lafw.c
index afdd950..76c5019 100644
--- a/libsigrok/hardware/fx2lafw/fx2lafw.c
+++ b/libsigrok/hardware/fx2lafw/fx2lafw.c
@@ -766,8 +766,8 @@ static void receive_transfer(struct libusb_transfer 
*transfer)
                                         */
                                        packet.type = SR_DF_LOGIC;
                                        packet.payload = &logic;
-                                       logic.length = ctx->trigger_stage;
-                                       logic.unitsize = 1;
+                                       logic.unitsize = 
sizeof(*ctx->trigger_buffer);
+                                       logic.length = ctx->trigger_stage * 
logic.unitsize;
                                        logic.data = ctx->trigger_buffer;
                                        sr_session_send(ctx->session_dev_id, 
&packet);
 
-- 
1.7.10


------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
sigrok-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/sigrok-devel

Reply via email to