2
0
forked from Ivasoft/DSView

fix channel disable/enalbe issues @ DSO mode

This commit is contained in:
DreamSourceLab
2015-06-17 23:24:17 +08:00
parent 248a446d67
commit 44051a295d
7 changed files with 59 additions and 14 deletions

View File

@@ -1430,7 +1430,14 @@ static int config_set(int id, GVariant *data, struct sr_dev_inst *sdi,
if (sdi->mode == DSO) {
ret = command_dso_ctrl(usb->devhdl, dso_cmd_gen(sdi, ch, SR_CONF_EN_CH));
ret = command_dso_ctrl(usb->devhdl, dso_cmd_gen(sdi, 0, SR_CONF_SAMPLERATE));
uint16_t channel_cnt = 0;
GSList *l;
for (l = sdi->channels; l; l = l->next) {
struct sr_channel *probe = (struct sr_channel *)l->data;
channel_cnt += probe->enabled;
}
if (channel_cnt != 0)
ret = command_dso_ctrl(usb->devhdl, dso_cmd_gen(sdi, 0, SR_CONF_SAMPLERATE));
}
if (ret == SR_OK)
sr_dbg("%s: setting ENABLE of channel %d to %d",

View File

@@ -1552,6 +1552,14 @@ static int config_set(int id, GVariant *data, struct sr_dev_inst *sdi,
ch->enabled = g_variant_get_boolean(data);
if (sdi->mode == DSO) {
ret = command_dso_ctrl(usb->devhdl, dso_cmd_gen(sdi, ch, SR_CONF_EN_CH));
uint16_t channel_cnt = 0;
GSList *l;
for (l = sdi->channels; l; l = l->next) {
struct sr_channel *probe = (struct sr_channel *)l->data;
channel_cnt += probe->enabled;
}
if (channel_cnt != 0)
ret = command_dso_ctrl(usb->devhdl, dso_cmd_gen(sdi, 0, SR_CONF_SAMPLERATE));
}
if (ret == SR_OK)
sr_dbg("%s: setting ENABLE of channel %d to %d",