2
0
forked from Ivasoft/DSView

Fix wave shake when measure high frequency signals @ dso mode

This commit is contained in:
DreamSourceLab
2020-01-09 21:48:39 +08:00
parent 7328b0b2cc
commit 235a863b3a
18 changed files with 213 additions and 126 deletions

View File

@@ -1048,7 +1048,8 @@ static int config_set(int id, GVariant *data, struct sr_dev_inst *sdi,
for(l = sdi->channels; l; l = l->next) {
struct sr_channel *probe = (struct sr_channel *)l->data;
probe->vpos_trans = devc->profile->dev_caps.default_pwmtrans;
probe->comb_comp = devc->profile->dev_caps.default_comb_comp;
//probe->comb_comp = devc->profile->dev_caps.default_comb_comp;
//probe->digi_fgain = 0;
if (probe->vga_ptr != NULL) {
for (i = 0; devc->profile->dev_caps.vdivs[i]; i++) {
for (j = 0; j < ARRAY_SIZE(vga_defaults); j++) {
@@ -1206,6 +1207,7 @@ static int config_set(int id, GVariant *data, struct sr_dev_inst *sdi,
} else if (id == SR_CONF_PROBE_COMB_COMP) {
ch->comb_comp = g_variant_get_int16(data);
ret = dsl_wr_dso(sdi, dso_cmd_gen(sdi, ch, SR_CONF_PROBE_VDIV));
ret = dsl_wr_dso(sdi, dso_cmd_gen(sdi, ch, SR_CONF_PROBE_OFFSET));
if (ret == SR_OK)
sr_dbg("%s: setting COMB_COMP of channel %d to %d mv",
__func__, ch->index, ch->comb_comp);

View File

@@ -728,8 +728,9 @@ SR_PRIV int dsl_fpga_arm(const struct sr_dev_inst *sdi)
setting.count_header = 0x0302;
setting.trig_pos_header = 0x0502;
setting.trig_glb_header = 0x0701;
setting.ch_en_header = 0x0801;
setting.dso_count_header = 0x0902;
setting.dso_count_header = 0x0802;
setting.ch_en_header = 0x0a02;
setting.fgain_header = 0x0c01;
setting.trig_header = 0x40a0;
setting.end_sync = 0xfa5afa5a;
@@ -1760,9 +1761,11 @@ static void get_measure(const struct sr_dev_inst *sdi, uint8_t *buf, uint32_t of
devc->mstatus.vlen = *((const uint32_t*)buf + offset/2 + 2/2) & 0x0fffffff;
devc->mstatus.stream_mode = (*((const uint32_t*)buf + offset/2 + 2/2) & 0x80000000) != 0;
devc->mstatus.measure_valid = *((const uint32_t*)buf + offset/2 + 2/2) & 0x40000000;
devc->mstatus.sample_divider = *((const uint32_t*)buf + offset/2 + 4/2) & 0x0fffffff;
devc->mstatus.sample_divider = *((const uint32_t*)buf + offset/2 + 4/2) & 0x00ffffff;
devc->mstatus.sample_divider_tog = (*((const uint32_t*)buf + offset/2 + 4/2) & 0x80000000) != 0;
devc->mstatus.trig_flag = (*((const uint32_t*)buf + offset/2 + 4/2) & 0x40000000) != 0;
devc->mstatus.trig_ch = (*((const uint8_t*)buf + offset*2 + 5*2+1) & 0x38) >> 3;
devc->mstatus.trig_offset = *((const uint8_t*)buf + offset*2 + 5*2+1) & 0x07;
devc->mstatus.ch0_max = *((const uint8_t*)buf + offset*2 + 33*2);
devc->mstatus.ch0_min = *((const uint8_t*)buf + offset*2 + 33*2+1);