SR_CONF_LIMIT_MSEC | SR_CONF_GET | SR_CONF_SET,
SR_CONF_LIMIT_SAMPLES | SR_CONF_GET | SR_CONF_SET,
SR_CONF_SAMPLERATE | 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 int32_t trigger_matches[] = {
case SR_CONF_LIMIT_SAMPLES:
*data = g_variant_new_uint64(devc->limit_samples);
break;
+#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;
}
devc->limit_samples = tmp;
devc->limit_msec = sigma_limit_samples_to_msec(devc, tmp);
break;
+#if ASIX_SIGMA_WITH_TRIGGER
case SR_CONF_CAPTURE_RATIO:
tmp = g_variant_get_uint64(data);
- if (tmp <= 100)
- devc->capture_ratio = tmp;
- else
- ret = SR_ERR;
+ if (tmp > 100)
+ return SR_ERR;
+ devc->capture_ratio = tmp;
break;
+#endif
default:
ret = SR_ERR_NA;
}
g_variant_builder_add(&gvb, "{sv}", "samplerates", gvar);
*data = g_variant_builder_end(&gvb);
break;
+#if ASIX_SIGMA_WITH_TRIGGER
case SR_CONF_TRIGGER_MATCH:
*data = g_variant_new_fixed_array(G_VARIANT_TYPE_INT32,
trigger_matches, ARRAY_SIZE(trigger_matches),
sizeof(int32_t));
break;
+#endif
default:
return SR_ERR_NA;
}
samples[2 * i + 0] = dram_cluster->samples[i].sample_hi;
}
- /* Send data up to trigger point (if triggered). */
+ /*
+ * If a trigger position applies, then provide the datafeed with
+ * the first part of data up to that position, then send the
+ * trigger marker.
+ */
int trigger_offset = 0;
if (triggered) {
/*
}
}
+ /*
+ * Send the data after the trigger, or all of the received data
+ * if no trigger position applies.
+ */
if (events_in_cluster > 0) {
packet.type = SR_DF_LOGIC;
logic.length = events_in_cluster * logic.unitsize;
#include <libsigrok/libsigrok.h>
#include "libsigrok-internal.h"
+/*
+ * 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 0
+
#define LOG_PREFIX "asix-sigma"
#define USB_VENDOR 0xa600