ols: Make constant names more precise, clarify comment

Reviewed-By: Wolfram Sang <wsa@kernel.org>
This commit is contained in:
v1ne 2020-03-31 20:20:25 +02:00 committed by Gerhard Sittig
parent a80bed7656
commit 58a75642e9
2 changed files with 21 additions and 14 deletions

View File

@ -502,6 +502,9 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi)
* to the channel mask. 1 means "disable channel".
*/
devc->capture_flags |= ~(ols_changrp_mask << 2) & 0x3c;
/* RLE mode is always zero, for now. */
arg[0] = devc->capture_flags & 0xff;
arg[1] = devc->capture_flags >> 8;
arg[2] = arg[3] = 0x00;

View File

@ -50,20 +50,24 @@
/* Trigger config */
#define TRIGGER_START (1 << 3)
/* Bitmasks for capture_flags */
/* 12-13 unused, 14-15 RLE mode (we hardcode mode 0). */
#define CAPTURE_FLAG_INTERNAL_TEST_MODE (1 << 11)
#define CAPTURE_FLAG_EXTERNAL_TEST_MODE (1 << 10)
#define CAPTURE_FLAG_SWAP_CHANNELS (1 << 9)
#define CAPTURE_FLAG_RLE (1 << 8)
#define CAPTURE_FLAG_SLOPE_FALLING (1 << 7)
#define CAPTURE_FLAG_CLOCK_EXTERNAL (1 << 6)
#define CAPTURE_FLAG_CHANNELGROUP_4 (1 << 5)
#define CAPTURE_FLAG_CHANNELGROUP_3 (1 << 4)
#define CAPTURE_FLAG_CHANNELGROUP_2 (1 << 3)
#define CAPTURE_FLAG_CHANNELGROUP_1 (1 << 2)
#define CAPTURE_FLAG_NOISE_FILTER (1 << 1)
#define CAPTURE_FLAG_DEMUX (1 << 0)
/* Bit mask used for "set flags" command (0x82) */
/* Take care about bit positions in diagrams, they are inverted. */
#define CAPTURE_FLAG_RLEMODE1 (1 << 15)
#define CAPTURE_FLAG_RLEMODE0 (1 << 14)
#define CAPTURE_FLAG_RESERVED1 (1 << 13)
#define CAPTURE_FLAG_RESERVED0 (1 << 12)
#define CAPTURE_FLAG_INTERNAL_TEST_MODE (1 << 11)
#define CAPTURE_FLAG_EXTERNAL_TEST_MODE (1 << 10)
#define CAPTURE_FLAG_SWAP_CHANNELS (1 << 9)
#define CAPTURE_FLAG_RLE (1 << 8)
#define CAPTURE_FLAG_INVERT_EXT_CLOCK (1 << 7)
#define CAPTURE_FLAG_CLOCK_EXTERNAL (1 << 6)
#define CAPTURE_FLAG_DISABLE_CHANGROUP_4 (1 << 5)
#define CAPTURE_FLAG_DISABLE_CHANGROUP_3 (1 << 4)
#define CAPTURE_FLAG_DISABLE_CHANGROUP_2 (1 << 3)
#define CAPTURE_FLAG_DISABLE_CHANGROUP_1 (1 << 2)
#define CAPTURE_FLAG_NOISE_FILTER (1 << 1)
#define CAPTURE_FLAG_DEMUX (1 << 0)
/* Capture context magic numbers */
#define OLS_NO_TRIGGER (-1)