]> sigrok.org Git - libsigrok.git/commit
asix-sigma: force strict boolen arith in LUT item manipulation
authorGerhard Sittig <redacted>
Sun, 17 May 2020 14:50:42 +0000 (16:50 +0200)
committerGerhard Sittig <redacted>
Sun, 31 May 2020 21:43:17 +0000 (23:43 +0200)
commitea57157d0d2e17e418463cf8e4f25453e5b903d7
tree053d88a23c1be7274dbca41deabc8b07a06dddca
parent3f5f5484100ba39dafa4d90b84d25cd3d871d2f2
asix-sigma: force strict boolen arith in LUT item manipulation

Mechanically adjust the add_trigger_function() routine to address nits,
attempt to improve maintainability.

Raise awareness of the fact that strict binary arithmetics is done (bit
operators are used), the strict 0..1 set of values needs to be enforced,
and mere "logical truthness" is not good enough in this spot. Explicitly
check for bit positions instead of "shifting out" the bit of interest
and have the 0/1 value result nearly by coincidence.

Extend comments. Group related instructions and separate them from other
groups. Reduce the scope of the rather generic i, j, tmp named variables
which are just too easy to get wrong.
src/hardware/asix-sigma/protocol.c