]> sigrok.org Git - libsigrok.git/blobdiff - src/hardware/demo/api.c
demo: introduce graycode generator mode
[libsigrok.git] / src / hardware / demo / api.c
index c5259b286144621d6f763ec611b7045df7ab49f2..d0abe4ff92e053f111c6cb44b7cc9e66f9aa0f50 100644 (file)
@@ -44,6 +44,7 @@ static const char *logic_pattern_str[] = {
        "all-low",
        "all-high",
        "squid",
+       "graycode",
 };
 
 static const uint32_t scanopts[] = {
@@ -119,6 +120,9 @@ static GSList *scan(struct sr_dev_driver *di, GSList *options)
        devc->cur_samplerate = SR_KHZ(200);
        devc->num_logic_channels = num_logic_channels;
        devc->logic_unitsize = (devc->num_logic_channels + 7) / 8;
+       devc->all_logic_channels_mask = 1UL << 0;
+       devc->all_logic_channels_mask <<= devc->num_logic_channels;
+       devc->all_logic_channels_mask--;
        devc->logic_pattern = DEFAULT_LOGIC_PATTERN;
        devc->num_analog_channels = num_analog_channels;