]> sigrok.org Git - libsigrok.git/commit
openbench-logic-sniffer/protocol: Fix hardcoded unitsize
authorPavel Fedin <redacted>
Tue, 21 Nov 2023 20:11:38 +0000 (23:11 +0300)
committerSoeren Apel <redacted>
Mon, 19 Aug 2024 20:32:47 +0000 (22:32 +0200)
commit5711e132c324a27050c10fcc6258cd3da7bdd8fc
tree662f874b618ecbf889c0369687051b44d400ae48
parent14a1e0bf1ae2d6315e2de08bf71167f5401a3385
openbench-logic-sniffer/protocol: Fix hardcoded unitsize

Some output modules, like srzip, calculate unitsize from maximum number of
channels in the session; and throw an error if the actual datastream uses
bigger size. Remove hardcoded value of 4 and calculate it from maximum number
of channels, supported by the device. Other driver seem to do the same.

This fixes "Unexpected unit size" saving a capture, made by an OLS device with
small number of channels.

The bug was found by using gillham's Arduino analyzer
(https://github.com/gillham/logic_analyzer), which supports a maximum of 8
channels. According to the error message, srzip expected unitsize == 1.

Signed-off-by: Pavel Fedin <redacted>
src/hardware/openbench-logic-sniffer/protocol.c
src/hardware/openbench-logic-sniffer/protocol.h