]> sigrok.org Git - libsigrok.git/commit - src/hardware/kingst-la2016/protocol.c
kingst-la2016: address endianess issue in data feed submission
authorGerhard Sittig <redacted>
Sat, 22 Jan 2022 10:47:56 +0000 (11:47 +0100)
committerGerhard Sittig <redacted>
Sun, 6 Feb 2022 17:53:53 +0000 (18:53 +0100)
commitfe953391bd7782813256c02350afa1996c773659
treeff303d4c5344a9d0366814a18b31f96ff15ebd47
parentc34f4a89d16c3001d4687a1281b98b63d9e61715
kingst-la2016: address endianess issue in data feed submission

Capture data was taken from the device in an endianess aware manner, but
submission to the session feed assumed a little endian host (and casted
an u8 pointer to u16 items, which is bad). Use an endianess aware writer
before sending accumulated sample data to the sigrok session. Address
remaining open coded byte counts in several send_chunk() places.

The conversion from LE (the device) to the host and to LE (the session)
may appear redundant, but is worth keeping in place when other models
with 32 channels should get added in a future implementation.
src/hardware/kingst-la2016/protocol.c