return SR_ERR;
}
} else if (probe->type == SR_PROBE_LOGIC) {
- if (probe->enabled)
+ if (probe->enabled) {
devc->enabled_digital_probes = g_slist_append(
devc->enabled_digital_probes, probe);
+ /* Turn on LA module if currently off. */
+ if (!devc->la_enabled) {
+ if (set_cfg(sdi, ":LA:DISP ON") != SR_OK)
+ return SR_ERR;
+ devc->la_enabled = TRUE;
+ }
+ }
if (probe->enabled != devc->digital_channels[probe->index]) {
/* Enabled channel is currently disabled, or vice versa. */
if (set_cfg(sdi, ":DIG%d:TURN %s", probe->index,
if (!devc->enabled_analog_probes && !devc->enabled_digital_probes)
return SR_ERR;
+ /* Turn off LA module if on and no digital probes selected. */
+ if (devc->la_enabled && !devc->enabled_digital_probes)
+ if (set_cfg(sdi, ":LA:DISP OFF") != SR_OK)
+ return SR_ERR;
+
if (devc->data_source == DATA_SOURCE_LIVE) {
if (set_cfg(sdi, ":RUN") != SR_OK)
return SR_ERR;
/* Digital channel state. */
if (devc->model->has_digital) {
- sr_dbg("Current digital channel state:");
+ if (get_cfg_string(sdi, ":LA:DISP?", &t_s) != SR_OK)
+ return SR_ERR;
+ devc->la_enabled = !strcmp(t_s, "ON") ? TRUE : FALSE;
+ sr_dbg("Logic analyzer %s, current digital channel state:",
+ devc->la_enabled ? "enabled" : "disabled");
for (i = 0; i < 16; i++) {
cmd = g_strdup_printf(":DIG%d:TURN?", i);
res = get_cfg_string(sdi, cmd, &t_s);
/* Device settings */
gboolean analog_channels[MAX_ANALOG_PROBES];
gboolean digital_channels[MAX_DIGITAL_PROBES];
+ gboolean la_enabled;
float timebase;
float vdiv[MAX_ANALOG_PROBES];
int vert_reference[MAX_ANALOG_PROBES];