]> sigrok.org Git - libsigrok.git/commitdiff
Deprecate SR_DI_TRIGGER_TYPES.
authorBert Vermeulen <redacted>
Fri, 25 Jan 2013 10:52:27 +0000 (11:52 +0100)
committerBert Vermeulen <redacted>
Fri, 25 Jan 2013 10:52:27 +0000 (11:52 +0100)
This is replaced by SR_CONF_TRIGGER_TYPE.

12 files changed:
hardware/asix-sigma/asix-sigma.c
hardware/chronovu-la8/api.c
hardware/chronovu-la8/protocol.h
hardware/fx2lafw/fx2lafw.c
hardware/fx2lafw/fx2lafw.h
hardware/link-mso19/api.c
hardware/link-mso19/protocol.h
hardware/openbench-logic-sniffer/api.c
hardware/openbench-logic-sniffer/protocol.h
hardware/zeroplus-logic-cube/zeroplus.c
libsigrok.h
strutil.c

index 7da0d97b2ba120218b153c7ccfaca4a2c1d20f34..13cb334203738ad63dc1efcdd820154055f55167 100644 (file)
@@ -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;
        }
index 4c349e5786f68554d2f855a5fa71d46e2ce39dff..bfeddaa1d0124e808db024cafbd8088b2535e40d 100644 (file)
@@ -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;
        }
index b28a81663c132fc5ad6b7163ed747968d6833834..07e04c2fb98d78733890e2d8890d2dd86f71c8ab 100644 (file)
@@ -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
 
index 4b442530fb28f733c31ce385af90ddc6d1403941..3b949940351798aed01b98c9fadd7709d654a829 100644 (file)
@@ -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;
        }
index 41cccc891015b3a1a1fd212d99beddbb9b42fabf..1e3c09906eca2ec69ab3f0e4b6f00b9dca410c06 100644 (file)
@@ -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
index cde523ecf6569e2ee4bbeb6c7189e1cd8ab054bc..77faf08b79fd4ed2d4918f27b28a9a905e0619bd 100644 (file)
@@ -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;
        }
index 9f7676a3dcee5cf2d521e8f99f6aa2210bc1315e..77a87bfee216cd5c016e1dc75f7cba0631e1f5c1 100644 (file)
@@ -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)
index 845dd254b6005e44a6e130d3893a9a613efd24c7..02945b8c533e25b37a4605f2ebd7f4355722087a 100644 (file)
@@ -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;
        }
index de0c0927ee799b475fb556b165066746b9d8e9f0..02ea4b490569fad7843ee23b17f604915cca80c8 100644 (file)
@@ -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
index ec34d306cb21d4de4c4779e45c12dfb9c040d635..91e7c4a8da66271f4be91962748b3c47488e0094 100644 (file)
@@ -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;
        }
index 9b40230ad3544a93347c9455508a306b42c5a06b..7ee2fa384729ab90be146a6fa1ea25c525b3a23d 100644 (file)
@@ -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,
 };
 
 /*
index a073a75800b2b26e7ad8e537fe8589bf827bff39..f22cd59c27b380e173d0477eef5bd156f8a7b126 100644 (file)
--- 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;