]> sigrok.org Git - libsigrok.git/commitdiff
fx2lafw: Basic implementation of hw_dev_config_set with SR_HWCAP_LIMIT_SAMPLES
authorJoel Holdsworth <redacted>
Mon, 27 Feb 2012 19:21:08 +0000 (19:21 +0000)
committerJoel Holdsworth <redacted>
Mon, 27 Feb 2012 21:58:25 +0000 (21:58 +0000)
hardware/fx2lafw/fx2lafw.c
hardware/fx2lafw/fx2lafw.h

index 636a0e7045d7e2616942f35a4e6baf710c04977c..850546dcc34c78d5a124e08aeb1184d7832d7637 100644 (file)
@@ -463,12 +463,24 @@ static int *hw_hwcap_get_all(void)
        return fx2lafw_capabilities;
 }
 
-static int hw_dev_config_set(int dev_index, int capability, void *value)
+static int hw_dev_config_set(int dev_index, int hwcap, void *value)
 {
-       (void)dev_index;
-       (void)capability;
-       (void)value;
-       return SR_OK;
+       struct sr_dev_inst *sdi;
+       struct fx2lafw_device *ctx;
+       int ret;
+
+       if (!(sdi = sr_dev_inst_get(dev_insts, dev_index)))
+               return SR_ERR;
+       ctx = sdi->priv;
+
+       if (hwcap == SR_HWCAP_LIMIT_SAMPLES) {
+               ctx->limit_samples = *(uint64_t *)value;
+               ret = SR_OK;
+       } else {
+               ret = SR_ERR;
+       }
+
+       return ret;
 }
 
 static int hw_dev_acquisition_start(int dev_index, gpointer session_data)
index 690c6deedb39f4a3dbd6bc9d53085b52e7baeab7..225b776591e9e7abc9904e778b040dcf5453189a 100644 (file)
@@ -52,6 +52,9 @@ struct fx2lafw_device {
         */
        GTimeVal fw_updated;
 
+       /* Device/Capture Settings */
+       uint64_t limit_samples;
+
        void *session_data;
 
        struct sr_usb_dev_inst *usb;