-#if 0
-static int configure_channels(const struct sr_dev_inst *sdi)
-{
- struct dev_context *devc;
- const struct sr_channel *ch;
- const GSList *l;
- int channel_bit, stage, i;
- char *tc;
-
- /* Note: sdi and sdi->priv are non-NULL, the caller checked this. */
- devc = sdi->priv;
-
- devc->channel_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->channels; l; l = l->next) {
- ch = (struct sr_channel *)l->data;
- if (ch->enabled == FALSE)
- continue;
- channel_bit = 1 << (ch->index);
- devc->channel_mask |= channel_bit;
-
- if (ch->trigger) {
- stage = 0;
- for (tc = ch->trigger; *tc; tc++) {
- devc->trigger_mask[stage] |= channel_bit;
- if (*tc == '1')
- devc->trigger_value[stage] |= channel_bit;
- stage++;
- if (stage > NUM_TRIGGER_STAGES)
- return SR_ERR;
- }
- }
- }
-
- return SR_OK;
-}
-#endif
-
-static int configure_channels(const struct sr_dev_inst *sdi)
-{
- struct dev_context *devc;
- const GSList *l;
- const struct sr_channel *ch;
- char *tc;
- int type;
-
- /* Note: sdi and sdi->priv are non-NULL, the caller checked this. */
- devc = sdi->priv;
-
- for (l = sdi->channels; l; l = l->next) {
- ch = (struct sr_channel *)l->data;
- if (ch->enabled == FALSE)
- continue;
-
- if ((tc = ch->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(ch->index, type);
- devc->trigger = 1;
- }
- }
-
- return SR_OK;
-}
-