return SR_OK;
if (rigol_ds_config_set(sdi, ":WAV:SOUR CHAN%d",
- ch->index + 1) != SR_OK)
+ ch->index + 1) != SR_OK)
return SR_ERR;
/* Check that the number of samples will be accepted */
if (rigol_ds_config_set(sdi, ":WAV:POIN %d", devc->analog_frame_size) != SR_OK)
break;
case PROTOCOL_V3:
if (rigol_ds_config_set(sdi, ":WAV:SOUR CHAN%d",
- ch->index + 1) != SR_OK)
+ ch->index + 1) != SR_OK)
return SR_ERR;
if (devc->data_source != DATA_SOURCE_LIVE) {
if (rigol_ds_config_set(sdi, ":WAV:RES") != SR_OK)
else
for (i = 0; i < len; i++)
devc->data[i] = (128 - devc->buffer[i]) * vdiv - offset;
- sr_analog_init(&analog, &encoding, &meaning, &spec, 0);
+ float vdivlog = log10f(vdiv);
+ int digits = -(int)vdivlog + (vdivlog < 0.0);
+ sr_analog_init(&analog, &encoding, &meaning, &spec, digits);
analog.meaning->channels = g_slist_append(NULL, ch);
analog.num_samples = len;
analog.data = devc->data;
SR_PRIV int rigol_ds_get_dev_cfg(const struct sr_dev_inst *sdi)
{
struct dev_context *devc;
+ struct sr_channel *ch;
char *cmd;
unsigned int i;
int res;
g_free(cmd);
if (res != SR_OK)
return SR_ERR;
+ ch = g_slist_nth_data(sdi->channels, i);
+ ch->enabled = devc->analog_channels[i];
}
sr_dbg("Current analog channel state:");
for (i = 0; i < devc->model->analog_channels; i++)
g_free(cmd);
if (res != SR_OK)
return SR_ERR;
+ ch = g_slist_nth_data(sdi->channels, i + devc->model->analog_channels);
+ ch->enabled = devc->digital_channels[i];
sr_dbg("D%d: %s", i, devc->digital_channels[i] ? "on" : "off");
}
}