]> sigrok.org Git - libsigrok.git/commit
ols: move sigrok channel creation from protocol.c to api.c
authorGerhard Sittig <redacted>
Sun, 14 Aug 2022 19:07:07 +0000 (21:07 +0200)
committerGerhard Sittig <redacted>
Wed, 24 Aug 2022 18:05:25 +0000 (20:05 +0200)
commitfbf9e657ac72c16ec4931065f87fa7a37279261c
tree36cfa0063a029d1021ac4d136fd8cd1ed9116b60
parent838f01227382bfd8e5b9c817e7fefff93d2c7b28
ols: move sigrok channel creation from protocol.c to api.c

It's unexpected that several code paths redundantly create sigrok
channels, and that most of them reside in the protocol.c source file.
Concentrate channel creation in api.c instead in the scan() routine,
to remain aware during maintenance.

Fallback to the maximum channel count for SUMP compatibles, prefer
metadata gathered from the device when available, including quirks for
models which are known to deviate. Just setup the number during probe,
and create the channels at the end of scan() in common code.

Change the channel count struct member to unsigned while we are here.
Shorten a long comment line to not have to break it.
src/hardware/openbench-logic-sniffer/api.c
src/hardware/openbench-logic-sniffer/protocol.c
src/hardware/openbench-logic-sniffer/protocol.h