/* Start acqusition. */
regval = WMR_TRGRES | WMR_SDRAMWRITEEN;
-#if ASIX_SIGMA_WITH_TRIGGER
- regval |= WMR_TRGEN;
-#endif
+ if (devc->use_triggers && ASIX_SIGMA_WITH_TRIGGER)
+ regval |= WMR_TRGEN;
ret = sigma_set_register(devc, WRITE_MODE, regval);
if (ret != SR_OK)
return ret;
devc = sdi->priv;
memset(&devc->trigger, 0, sizeof(devc->trigger));
+ devc->use_triggers = FALSE;
trigger = sr_session_trigger_get(sdi->session);
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;
}
}
+ /* Keep track whether triggers are involved during acquisition. */
+ devc->use_triggers = TRUE;
+
return SR_OK;
}
* See the previous get_trigger_offset() implementation. This
* code needs to get re-used here.
*/
- (void)devc;
+ if (!devc->use_triggers)
+ return FALSE;
+
(void)sample;
(void)get_trigger_offset;
sr_err("Could not query capture positions/state.");
return FALSE;
}
+ if (!devc->use_triggers)
+ triggerpos = ~0;
trg_line = ~0UL;
trg_event = ~0UL;
if (modestatus & RMR_TRIGGERED) {
size_t bitidx, condidx;
uint16_t value, mask;
- /* Start assuming simple triggers. */
+ /* Setup something that "won't match" in the absence of a spec. */
memset(lut, 0, sizeof(*lut));
+ if (!devc->use_triggers)
+ return SR_OK;
+
+ /* Start assuming simple triggers. Edges are handled below. */
lut->m4 = 0xa000;
lut->m3q = 0xffff;