setup_changed = TRUE;
break;
case SR_CHANNEL_LOGIC:
+ i = ch->index - DLM_DIG_CHAN_INDEX_OFFS;
if (ch->enabled)
- pod_enabled[ch->index / 8] = TRUE;
+ pod_enabled[i / 8] = TRUE;
- if (ch->enabled == state->digital_states[ch->index])
+ if (ch->enabled == state->digital_states[i])
break;
- if (dlm_digital_chan_state_set(scpi, ch->index + 1,
+ if (dlm_digital_chan_state_set(scpi, i + 1,
ch->enabled) != SR_OK)
return SR_ERR;
- state->digital_states[ch->index] = ch->enabled;
+ state->digital_states[i] = ch->enabled;
setup_changed = TRUE;
break;
default:
devc->digital_groups = g_malloc0(sizeof(struct sr_channel_group*) *
scope_models[model_index].digital_channels);
- /* Add analog channels. */
+ /* Add analog channels, each in its own group. */
for (i = 0; i < scope_models[model_index].analog_channels; i++) {
ch = sr_channel_new(sdi, i, SR_CHANNEL_ANALOG, TRUE,
(*scope_models[model_index].analog_names)[i]);
/* Add digital channels. */
for (i = 0; i < scope_models[model_index].digital_channels; i++) {
- ch = sr_channel_new(sdi, i, SR_CHANNEL_LOGIC, TRUE,
+ ch = sr_channel_new(sdi, DLM_DIG_CHAN_INDEX_OFFS + i,
+ SR_CHANNEL_LOGIC, TRUE,
(*scope_models[model_index].digital_names)[i]);
devc->digital_groups[i / 8]->channels = g_slist_append(