]> sigrok.org Git - libsigrok.git/commitdiff
asix-sigma: unconditionally re-enable trigger support code
authorGerhard Sittig <redacted>
Sun, 31 May 2020 10:36:11 +0000 (12:36 +0200)
committerGerhard Sittig <redacted>
Sun, 31 May 2020 21:56:16 +0000 (23:56 +0200)
Trigger support became operational again. Drop the compile time switch
which disabled the previously incomplete implementation.

This resolves bug #359.

src/hardware/asix-sigma/api.c
src/hardware/asix-sigma/protocol.c
src/hardware/asix-sigma/protocol.h

index fd9546882ee3a336c1998be3fa4a256a00e03a43..f56bdd45bc2c4589a2bf560d5baa2c01653c5035 100644 (file)
@@ -49,10 +49,8 @@ static const uint32_t devopts[] = {
        SR_CONF_EXTERNAL_CLOCK | SR_CONF_GET | SR_CONF_SET,
        SR_CONF_EXTERNAL_CLOCK_SOURCE | SR_CONF_GET | SR_CONF_SET | SR_CONF_LIST,
        SR_CONF_CLOCK_EDGE | SR_CONF_GET | SR_CONF_SET | SR_CONF_LIST,
-#if ASIX_SIGMA_WITH_TRIGGER
        SR_CONF_TRIGGER_MATCH | SR_CONF_LIST,
        SR_CONF_CAPTURE_RATIO | SR_CONF_GET | SR_CONF_SET,
-#endif
 };
 
 static const char *ext_clock_edges[] = {
@@ -61,14 +59,12 @@ static const char *ext_clock_edges[] = {
        [SIGMA_CLOCK_EDGE_EITHER] = "either",
 };
 
-#if ASIX_SIGMA_WITH_TRIGGER
 static const int32_t trigger_matches[] = {
        SR_TRIGGER_ZERO,
        SR_TRIGGER_ONE,
        SR_TRIGGER_RISING,
        SR_TRIGGER_FALLING,
 };
-#endif
 
 static void clear_helper(struct dev_context *devc)
 {
@@ -317,11 +313,9 @@ static int config_get(uint32_t key, GVariant **data,
        case SR_CONF_LIMIT_MSEC:
        case SR_CONF_LIMIT_SAMPLES:
                return sr_sw_limits_config_get(&devc->limit.config, key, data);
-#if ASIX_SIGMA_WITH_TRIGGER
        case SR_CONF_CAPTURE_RATIO:
                *data = g_variant_new_uint64(devc->capture_ratio);
                break;
-#endif
        default:
                return SR_ERR_NA;
        }
@@ -376,11 +370,9 @@ static int config_set(uint32_t key, GVariant *data,
        case SR_CONF_LIMIT_MSEC:
        case SR_CONF_LIMIT_SAMPLES:
                return sr_sw_limits_config_set(&devc->limit.config, key, data);
-#if ASIX_SIGMA_WITH_TRIGGER
        case SR_CONF_CAPTURE_RATIO:
                devc->capture_ratio = g_variant_get_uint64(data);
                break;
-#endif
        default:
                return SR_ERR_NA;
        }
@@ -407,11 +399,9 @@ static int config_list(uint32_t key, GVariant **data,
        case SR_CONF_CLOCK_EDGE:
                *data = g_variant_new_strv(ARRAY_AND_SIZE(ext_clock_edges));
                break;
-#if ASIX_SIGMA_WITH_TRIGGER
        case SR_CONF_TRIGGER_MATCH:
                *data = std_gvar_array_i32(ARRAY_AND_SIZE(trigger_matches));
                break;
-#endif
        default:
                return SR_ERR_NA;
        }
@@ -593,7 +583,7 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi)
 
        /* Start acqusition. */
        regval = WMR_TRGRES | WMR_SDRAMWRITEEN;
-       if (devc->use_triggers && ASIX_SIGMA_WITH_TRIGGER)
+       if (devc->use_triggers)
                regval |= WMR_TRGEN;
        ret = sigma_set_register(devc, WRITE_MODE, regval);
        if (ret != SR_OK)
index 5755e77f821f37197dd8db438fd86a0d9de78798..232c69371fd52e33d7240ecabe36795e635c870c 100644 (file)
@@ -1536,11 +1536,6 @@ SR_PRIV int sigma_convert_trigger(const struct sr_dev_inst *sdi)
        if (!trigger)
                return SR_OK;
 
-       if (!ASIX_SIGMA_WITH_TRIGGER) {
-               sr_warn("Trigger support is not implemented. Ignoring the spec.");
-               return SR_OK;
-       }
-
        trigger_set = 0;
        for (l = trigger->stages; l; l = l->next) {
                stage = l->data;
index 574183affb60f8ac40b48e528e749ea79ad00b59..26370170481e008e97954ca2826ab5b4a0dd5869 100644 (file)
 
 #define LOG_PREFIX "asix-sigma"
 
-/*
- * Triggers are not working in this implementation. Stop claiming
- * support for the feature which effectively is not available, until
- * the implementation got fixed. Yet keep the code in place and allow
- * developers to turn on this switch during development.
- */
-#define ASIX_SIGMA_WITH_TRIGGER        1
-
 /* Experimental support for OMEGA (scan only, operation is ENOIMPL). */
 #define ASIX_WITH_OMEGA 0