- probenum = probe->name[2] == '1' ? 0 : 1;
- if (probe->enabled)
- devc->enabled_probes = g_slist_append(devc->enabled_probes, probe);
-
- if (probe->enabled != devc->channels[probenum]) {
- /* Enabled channel is currently disabled, or vice versa. */
- sprintf(cmd, ":CHAN%d:DISP %s", probenum + 1,
- probe->enabled ? "ON" : "OFF");
- if (rigol_ds1xx2_send(devc, cmd) != SR_OK)
- return SR_ERR;
+ sr_dbg("handling probe %s", probe->name);
+ if (probe->type == SR_PROBE_ANALOG) {
+ if (probe->enabled)
+ devc->enabled_analog_probes = g_slist_append(
+ devc->enabled_analog_probes, probe);
+ if (probe->enabled != devc->analog_channels[probe->index]) {
+ /* Enabled channel is currently disabled, or vice versa. */
+ sprintf(cmd, ":CHAN%d:DISP %s", probe->index + 1,
+ probe->enabled ? "ON" : "OFF");
+ if (rigol_ds1xx2_send(devc, cmd) != SR_OK)
+ return SR_ERR;
+ }
+ } else if (probe->type == SR_PROBE_LOGIC) {
+ if (probe->enabled)
+ devc->enabled_digital_probes = g_slist_append(
+ devc->enabled_digital_probes, probe);
+ if (probe->enabled != devc->digital_channels[probe->index]) {
+ /* Enabled channel is currently disabled, or vice versa. */
+ sprintf(cmd, ":DIG%d:TURN %s", probe->index,
+ probe->enabled ? "ON" : "OFF");
+ if (rigol_ds1xx2_send(devc, cmd) != SR_OK)
+ return SR_ERR;
+ }