From: Bert Vermeulen Date: Fri, 25 Jan 2013 10:52:27 +0000 (+0100) Subject: Deprecate SR_DI_TRIGGER_TYPES. X-Git-Tag: dsupstream~310 X-Git-Url: http://sigrok.org/gitweb/?p=libsigrok.git;a=commitdiff_plain;h=c50277a6ec09fb35de3a6e0f2ae3401bc72a1526 Deprecate SR_DI_TRIGGER_TYPES. This is replaced by SR_CONF_TRIGGER_TYPE. --- diff --git a/hardware/asix-sigma/asix-sigma.c b/hardware/asix-sigma/asix-sigma.c index 7da0d97b..13cb3342 100644 --- a/hardware/asix-sigma/asix-sigma.c +++ b/hardware/asix-sigma/asix-sigma.c @@ -37,7 +37,7 @@ #define USB_VENDOR_NAME "ASIX" #define USB_MODEL_NAME "SIGMA" #define USB_MODEL_VERSION "" -#define TRIGGER_TYPES "rf10" +#define TRIGGER_TYPE "rf10" #define NUM_PROBES 16 SR_PRIV struct sr_dev_driver asix_sigma_driver_info; @@ -795,9 +795,6 @@ static int config_get(int id, const void **data, const struct sr_dev_inst *sdi) case SR_DI_HWCAPS: *data = hwcaps; break; - case SR_DI_TRIGGER_TYPES: - *data = (char *)TRIGGER_TYPES; - break; case SR_CONF_SAMPLERATE: if (sdi) { devc = sdi->priv; @@ -849,6 +846,9 @@ static int config_list(int key, const void **data, const struct sr_dev_inst *sdi case SR_CONF_SAMPLERATE: *data = &samplerates; break; + case SR_CONF_TRIGGER_TYPE: + *data = (char *)TRIGGER_TYPE; + break; default: return SR_ERR_ARG; } diff --git a/hardware/chronovu-la8/api.c b/hardware/chronovu-la8/api.c index 4c349e57..bfeddaa1 100644 --- a/hardware/chronovu-la8/api.c +++ b/hardware/chronovu-la8/api.c @@ -296,11 +296,6 @@ static int config_get(int id, const void **data, const struct sr_dev_inst *sdi) case SR_DI_HWCAPS: *data = hwcaps; break; - case SR_DI_TRIGGER_TYPES: - *data = (char *)TRIGGER_TYPES; - sr_spew("%s: Returning trigger types: %s.", __func__, - TRIGGER_TYPES); - break; case SR_CONF_SAMPLERATE: if (sdi) { devc = sdi->priv; @@ -370,6 +365,9 @@ static int config_list(int key, const void **data, const struct sr_dev_inst *sdi fill_supported_samplerates_if_needed(); *data = &samplerates; break; + case SR_CONF_TRIGGER_TYPE: + *data = (char *)TRIGGER_TYPE; + break; default: return SR_ERR_ARG; } diff --git a/hardware/chronovu-la8/protocol.h b/hardware/chronovu-la8/protocol.h index b28a8166..07e04c2f 100644 --- a/hardware/chronovu-la8/protocol.h +++ b/hardware/chronovu-la8/protocol.h @@ -43,7 +43,7 @@ #define USB_MODEL_VERSION "" #define NUM_PROBES 8 -#define TRIGGER_TYPES "01" +#define TRIGGER_TYPE "01" #define SDRAM_SIZE (8 * 1024 * 1024) #define MIN_NUM_SAMPLES 1 diff --git a/hardware/fx2lafw/fx2lafw.c b/hardware/fx2lafw/fx2lafw.c index 4b442530..3b949940 100644 --- a/hardware/fx2lafw/fx2lafw.c +++ b/hardware/fx2lafw/fx2lafw.c @@ -610,9 +610,6 @@ static int config_get(int id, const void **data, const struct sr_dev_inst *sdi) case SR_DI_HWCAPS: *data = hwcaps; break; - case SR_DI_TRIGGER_TYPES: - *data = TRIGGER_TYPES; - break; case SR_CONF_SAMPLERATE: if (sdi) { devc = sdi->priv; @@ -656,6 +653,9 @@ static int config_list(int key, const void **data, const struct sr_dev_inst *sdi case SR_CONF_SAMPLERATE: *data = &samplerates; break; + case SR_CONF_TRIGGER_TYPE: + *data = TRIGGER_TYPE; + break; default: return SR_ERR_ARG; } diff --git a/hardware/fx2lafw/fx2lafw.h b/hardware/fx2lafw/fx2lafw.h index 41cccc89..1e3c0990 100644 --- a/hardware/fx2lafw/fx2lafw.h +++ b/hardware/fx2lafw/fx2lafw.h @@ -35,7 +35,7 @@ #define USB_INTERFACE 0 #define USB_CONFIGURATION 1 #define NUM_TRIGGER_STAGES 4 -#define TRIGGER_TYPES "01" +#define TRIGGER_TYPE "01" #define MAX_RENUM_DELAY_MS 3000 #define NUM_SIMUL_TRANSFERS 32 diff --git a/hardware/link-mso19/api.c b/hardware/link-mso19/api.c index cde523ec..77faf08b 100644 --- a/hardware/link-mso19/api.c +++ b/hardware/link-mso19/api.c @@ -306,9 +306,6 @@ static int config_get(int id, const void **data, const struct sr_dev_inst *sdi) case SR_DI_HWCAPS: *data = hwcaps; break; - case SR_DI_TRIGGER_TYPES: - *data = (char *)TRIGGER_TYPES; - break; case SR_CONF_SAMPLERATE: if (sdi) { devc = sdi->priv; @@ -398,6 +395,9 @@ static int config_list(int key, const void **data, const struct sr_dev_inst *sdi case SR_CONF_SAMPLERATE: *data = &samplerates; break; + case SR_CONF_TRIGGER_TYPE: + *data = (char *)TRIGGER_TYPE; + break; default: return SR_ERR_ARG; } diff --git a/hardware/link-mso19/protocol.h b/hardware/link-mso19/protocol.h index 9f7676a3..77a87bfe 100644 --- a/hardware/link-mso19/protocol.h +++ b/hardware/link-mso19/protocol.h @@ -43,7 +43,7 @@ #define NUM_PROBES 8 #define NUM_TRIGGER_STAGES 4 -#define TRIGGER_TYPES "01" //the first r/f is used for the whole group +#define TRIGGER_TYPE "01" //the first r/f is used for the whole group #define SERIALCOMM "460800/8n1/flow=2" #define SERIALCONN "/dev/ttyUSB0" #define CLOCK_RATE SR_MHZ(100) diff --git a/hardware/openbench-logic-sniffer/api.c b/hardware/openbench-logic-sniffer/api.c index 845dd254..02945b8c 100644 --- a/hardware/openbench-logic-sniffer/api.c +++ b/hardware/openbench-logic-sniffer/api.c @@ -261,9 +261,6 @@ static int config_get(int id, const void **data, const struct sr_dev_inst *sdi) case SR_DI_HWCAPS: *data = hwcaps; break; - case SR_DI_TRIGGER_TYPES: - *data = (char *)TRIGGER_TYPES; - break; case SR_CONF_SAMPLERATE: if (sdi) { devc = sdi->priv; @@ -335,6 +332,9 @@ static int config_list(int key, const void **data, const struct sr_dev_inst *sdi case SR_CONF_SAMPLERATE: *data = &samplerates; break; + case SR_CONF_TRIGGER_TYPE: + *data = (char *)TRIGGER_TYPE; + break; default: return SR_ERR_ARG; } diff --git a/hardware/openbench-logic-sniffer/protocol.h b/hardware/openbench-logic-sniffer/protocol.h index de0c0927..02ea4b49 100644 --- a/hardware/openbench-logic-sniffer/protocol.h +++ b/hardware/openbench-logic-sniffer/protocol.h @@ -37,7 +37,7 @@ #define NUM_PROBES 32 #define NUM_TRIGGER_STAGES 4 -#define TRIGGER_TYPES "01" +#define TRIGGER_TYPE "01" #define SERIAL_SPEED B115200 #define CLOCK_RATE SR_MHZ(100) #define MIN_NUM_SAMPLES 4 diff --git a/hardware/zeroplus-logic-cube/zeroplus.c b/hardware/zeroplus-logic-cube/zeroplus.c index ec34d306..91e7c4a8 100644 --- a/hardware/zeroplus-logic-cube/zeroplus.c +++ b/hardware/zeroplus-logic-cube/zeroplus.c @@ -38,7 +38,7 @@ #define USB_INTERFACE 0 #define USB_CONFIGURATION 1 #define NUM_TRIGGER_STAGES 4 -#define TRIGGER_TYPES "01" +#define TRIGGER_TYPE "01" #define PACKET_SIZE 2048 /* ?? */ @@ -537,10 +537,6 @@ static int config_get(int id, const void **data, const struct sr_dev_inst *sdi) case SR_DI_HWCAPS: *data = hwcaps; break; - case SR_DI_TRIGGER_TYPES: - *data = TRIGGER_TYPES; - sr_spew("zp: %s: Returning triggertypes: %s.", __func__, TRIGGER_TYPES); - break; case SR_CONF_SAMPLERATE: if (sdi) { devc = sdi->priv; @@ -654,6 +650,9 @@ static int config_list(int key, const void **data, const struct sr_dev_inst *sdi case SR_CONF_SAMPLERATE: *data = &samplerates; break; + case SR_CONF_TRIGGER_TYPE: + *data = TRIGGER_TYPE; + break; default: return SR_ERR_ARG; } diff --git a/libsigrok.h b/libsigrok.h index 9b40230a..7ee2fa38 100644 --- a/libsigrok.h +++ b/libsigrok.h @@ -461,6 +461,9 @@ enum { /** Coupling. */ SR_CONF_COUPLING, + /** Trigger types. */ + SR_CONF_TRIGGER_TYPE, + /*--- Special stuff -------------------------------------------------*/ /** Session filename. */ @@ -551,8 +554,6 @@ enum { SR_DI_HWOPTS = 10000, /** A list of capabilities supported by the device. */ SR_DI_HWCAPS, - /** Types of logic trigger supported, out of "01crf" (char *). */ - SR_DI_TRIGGER_TYPES, }; /* diff --git a/strutil.c b/strutil.c index a073a758..f22cd59c 100644 --- a/strutil.c +++ b/strutil.c @@ -230,7 +230,7 @@ SR_API char **sr_parse_triggerstring(const struct sr_dev_inst *sdi, return NULL; } - if (sdi->driver->config_get(SR_DI_TRIGGER_TYPES, + if (sdi->driver->config_list(SR_CONF_TRIGGER_TYPE, (const void **)&trigger_types, sdi) != SR_OK) { sr_err("%s: Device doesn't support any triggers.", __func__); return NULL;