From: Joel Holdsworth Date: Mon, 27 Feb 2012 19:21:08 +0000 (+0000) Subject: fx2lafw: Basic implementation of hw_dev_config_set with SR_HWCAP_LIMIT_SAMPLES X-Git-Tag: libsigrok-0.1.0~87 X-Git-Url: http://sigrok.org/gitweb/?a=commitdiff_plain;h=7cb621d418281f64144048e6257055b1b25b5da9;p=libsigrok.git fx2lafw: Basic implementation of hw_dev_config_set with SR_HWCAP_LIMIT_SAMPLES --- diff --git a/hardware/fx2lafw/fx2lafw.c b/hardware/fx2lafw/fx2lafw.c index 636a0e70..850546dc 100644 --- a/hardware/fx2lafw/fx2lafw.c +++ b/hardware/fx2lafw/fx2lafw.c @@ -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) diff --git a/hardware/fx2lafw/fx2lafw.h b/hardware/fx2lafw/fx2lafw.h index 690c6dee..225b7765 100644 --- a/hardware/fx2lafw/fx2lafw.h +++ b/hardware/fx2lafw/fx2lafw.h @@ -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;