From: v1ne Date: Tue, 31 Mar 2020 18:20:25 +0000 (+0200) Subject: ols: Make constant names more precise, clarify comment X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=58a75642e910c61b333dc30f522467a9e82130bc;p=libsigrok.git ols: Make constant names more precise, clarify comment Reviewed-By: Wolfram Sang --- diff --git a/src/hardware/openbench-logic-sniffer/api.c b/src/hardware/openbench-logic-sniffer/api.c index 3e632b47..dbf7296a 100644 --- a/src/hardware/openbench-logic-sniffer/api.c +++ b/src/hardware/openbench-logic-sniffer/api.c @@ -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; diff --git a/src/hardware/openbench-logic-sniffer/protocol.h b/src/hardware/openbench-logic-sniffer/protocol.h index fa78ca79..25e37a00 100644 --- a/src/hardware/openbench-logic-sniffer/protocol.h +++ b/src/hardware/openbench-logic-sniffer/protocol.h @@ -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)