From: Gerhard Sittig Date: Sun, 31 May 2020 10:36:11 +0000 (+0200) Subject: asix-sigma: unconditionally re-enable trigger support code X-Git-Url: https://sigrok.org/gitweb/?p=libsigrok.git;a=commitdiff_plain;h=e09267136518776a5afc42049d1953360f2d3966 asix-sigma: unconditionally re-enable trigger support code Trigger support became operational again. Drop the compile time switch which disabled the previously incomplete implementation. This resolves bug #359. --- diff --git a/src/hardware/asix-sigma/api.c b/src/hardware/asix-sigma/api.c index fd954688..f56bdd45 100644 --- a/src/hardware/asix-sigma/api.c +++ b/src/hardware/asix-sigma/api.c @@ -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) diff --git a/src/hardware/asix-sigma/protocol.c b/src/hardware/asix-sigma/protocol.c index 5755e77f..232c6937 100644 --- a/src/hardware/asix-sigma/protocol.c +++ b/src/hardware/asix-sigma/protocol.c @@ -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; diff --git a/src/hardware/asix-sigma/protocol.h b/src/hardware/asix-sigma/protocol.h index 574183af..26370170 100644 --- a/src/hardware/asix-sigma/protocol.h +++ b/src/hardware/asix-sigma/protocol.h @@ -33,14 +33,6 @@ #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