-#if 0
-static int configure_probes(const struct sr_dev_inst *sdi)
-{
- struct dev_context *devc;
- const struct sr_probe *probe;
- const GSList *l;
- int probe_bit, stage, i;
- char *tc;
-
- /* Note: sdi and sdi->priv are non-NULL, the caller checked this. */
- devc = sdi->priv;
-
- devc->probe_mask = 0;
- for (i = 0; i < NUM_TRIGGER_STAGES; i++) {
- devc->trigger_mask[i] = 0;
- devc->trigger_value[i] = 0;
- }
-
- stage = -1;
- for (l = sdi->probes; l; l = l->next) {
- probe = (struct sr_probe *)l->data;
- if (probe->enabled == FALSE)
- continue;
- probe_bit = 1 << (probe->index);
- devc->probe_mask |= probe_bit;
-
- if (probe->trigger) {
- stage = 0;
- for (tc = probe->trigger; *tc; tc++) {
- devc->trigger_mask[stage] |= probe_bit;
- if (*tc == '1')
- devc->trigger_value[stage] |= probe_bit;
- stage++;
- if (stage > NUM_TRIGGER_STAGES)
- return SR_ERR;
- }
- }
- }
-
- return SR_OK;
-}
-#endif
-
-static int configure_probes(const struct sr_dev_inst *sdi)
-{
- struct dev_context *devc;
- const GSList *l;
- const struct sr_probe *probe;
- char *tc;
- int type;
-
- /* Note: sdi and sdi->priv are non-NULL, the caller checked this. */
- devc = sdi->priv;
-
- for (l = sdi->probes; l; l = l->next) {
- probe = (struct sr_probe *)l->data;
- if (probe->enabled == FALSE)
- continue;
-
- if ((tc = probe->trigger)) {
- switch (*tc) {
- case '1':
- type = TRIGGER_HIGH;
- break;
- case '0':
- type = TRIGGER_LOW;
- break;
-#if 0
- case 'r':
- type = TRIGGER_POSEDGE;
- break;
- case 'f':
- type = TRIGGER_NEGEDGE;
- break;
- case 'c':
- type = TRIGGER_ANYEDGE;
- break;
-#endif
- default:
- return SR_ERR;
- }
- analyzer_add_trigger(probe->index, type);
- devc->trigger = 1;
- }
- }
-
- return SR_OK;
-}
-