From: Lars-Peter Clausen Date: Thu, 21 Jun 2012 17:54:29 +0000 (+0200) Subject: sr: fx2lafw: Set correct unitsize for trigger buffer X-Git-Tag: dsupstream~901 X-Git-Url: https://sigrok.org/gitweb/?a=commitdiff_plain;h=fa114e4ab1ef0d30bb3cce8f926e43d66df9f787;hp=e05a174be2f9142471ad94a1af2b3722efd9c6ae;p=libsigrok.git sr: fx2lafw: Set correct unitsize for trigger buffer 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 --- diff --git a/hardware/fx2lafw/fx2lafw.c b/hardware/fx2lafw/fx2lafw.c index afdd9501..76c5019d 100644 --- a/hardware/fx2lafw/fx2lafw.c +++ b/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);