]> sigrok.org Git - libsigrok.git/commit
asix-sigma: improve error propagation, increase robustness
authorGerhard Sittig <redacted>
Fri, 15 May 2020 10:13:32 +0000 (12:13 +0200)
committerGerhard Sittig <redacted>
Fri, 29 May 2020 06:06:18 +0000 (08:06 +0200)
commit88a5f9eabe72113d70c29d45dc12eabc0add9c49
treef6de65a1381c8bf3e2d55d97c9c458fb65e17e6d
parent5c231fc466fac5da4b24f79a29af7a3fa0a10f76
asix-sigma: improve error propagation, increase robustness

Detect more error conditions, and unbreak those code paths where wrong
data was forwarded. It's essential to tell the USB communication layer,
sigrok API error codes, and glib mainloop receive callbacks apart. Since
the compiler won't notice, maintainers have to be extra careful.

Rephrase diagnostics messages. The debug and spew levels are intended
for developers, but the error/warn/info levels will get presented to
users, should read more fluently and speak from the application's POV.
Allow long text lines in source code, to not break string literals which
users will report and developers need to search for (this matches Linux
kernel coding style).

This commit also combines the retrieval of sample memory fill level,
trigger position, and status flags. Since these values span an adjacent
set of FPGA registers. Which reduces USB communication overhead, and
simplifies error handling. The helper routine considers the retrieval
of each of these values as optional from the caller's perspective, to
simplify other use cases (mode check during acquisition, before sample
download after acquisition has stopped).

INIT pin sensing after PROG pin pulsing was reworked, to handle the
technicalities of the FTDI chip and its USB communication and the FTDI
library which is an external dependency of this device driver. Captures
of USB traffic suggest that pin state is communicated at arbitrary times.
src/hardware/asix-sigma/api.c
src/hardware/asix-sigma/protocol.c