]> sigrok.org Git - libsigrok.git/commitdiff
chronovu-la: LA16 has fewer max. samples than LA8.
authorUwe Hermann <redacted>
Wed, 2 Apr 2014 07:29:23 +0000 (09:29 +0200)
committerUwe Hermann <redacted>
Wed, 2 Apr 2014 15:20:10 +0000 (17:20 +0200)
Each LA16 sample is 16bits wide (LA8 samples are 8 bits wide). Adapt the
number returned for SR_CONF_LIMIT_SAMPLES in config_list() accordingly.

hardware/chronovu-la/api.c

index 228d632aac23879d7ae0a6146a2265a12cf2b640..292da5a4d3d8729ad4a27fe7edf6a95e356e4713 100644 (file)
@@ -355,8 +355,13 @@ static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi,
                *data = g_variant_builder_end(&gvb);
                break;
        case SR_CONF_LIMIT_SAMPLES:
+               if (!sdi || !sdi->priv || !(devc = sdi->priv) || !devc->prof)
+                       return SR_ERR_BUG;
                grange[0] = g_variant_new_uint64(0);
-               grange[1] = g_variant_new_uint64(MAX_NUM_SAMPLES);
+               if (devc->prof->model == CHRONOVU_LA8)
+                       grange[1] = g_variant_new_uint64(MAX_NUM_SAMPLES);
+               else
+                       grange[1] = g_variant_new_uint64(MAX_NUM_SAMPLES / 2);
                *data = g_variant_new_tuple(grange, 2);
                break;
        case SR_CONF_TRIGGER_TYPE: