rigol-ds: Don't run rigol_ds_block_wait() code unless supported.
This commit is contained in:
parent
aff00e4088
commit
4472867a9f
|
@ -261,29 +261,32 @@ static int rigol_ds_block_wait(const struct sr_dev_inst *sdi)
|
||||||
if (!(devc = sdi->priv))
|
if (!(devc = sdi->priv))
|
||||||
return SR_ERR;
|
return SR_ERR;
|
||||||
|
|
||||||
start = time(NULL);
|
if (devc->model->series->protocol >= PROTOCOL_V3) {
|
||||||
|
|
||||||
do {
|
start = time(NULL);
|
||||||
if (time(NULL) - start >= 3) {
|
|
||||||
sr_dbg("Timeout waiting for data block");
|
|
||||||
return SR_ERR_TIMEOUT;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
do {
|
||||||
* The scope copies data really slowly from sample
|
if (time(NULL) - start >= 3) {
|
||||||
* memory to its output buffer, so try not to bother
|
sr_dbg("Timeout waiting for data block");
|
||||||
* it too much with SCPI requests but don't wait too
|
return SR_ERR_TIMEOUT;
|
||||||
* long for short sample frame sizes.
|
}
|
||||||
*/
|
|
||||||
g_usleep(devc->analog_frame_size < 15000 ? 100000 : 1000000);
|
|
||||||
|
|
||||||
/* "READ,nnnn" (still working) or "IDLE,nnnn" (finished) */
|
/*
|
||||||
if (sr_scpi_get_string(sdi->conn, ":WAV:STAT?", &buf) != SR_OK)
|
* The scope copies data really slowly from sample
|
||||||
return SR_ERR;
|
* memory to its output buffer, so try not to bother
|
||||||
|
* it too much with SCPI requests but don't wait too
|
||||||
|
* long for short sample frame sizes.
|
||||||
|
*/
|
||||||
|
g_usleep(devc->analog_frame_size < 15000 ? 100000 : 1000000);
|
||||||
|
|
||||||
if (parse_int(buf + 5, &len) != SR_OK)
|
/* "READ,nnnn" (still working) or "IDLE,nnnn" (finished) */
|
||||||
return SR_ERR;
|
if (sr_scpi_get_string(sdi->conn, ":WAV:STAT?", &buf) != SR_OK)
|
||||||
} while (buf[0] == 'R' && len < 1000000);
|
return SR_ERR;
|
||||||
|
|
||||||
|
if (parse_int(buf + 5, &len) != SR_OK)
|
||||||
|
return SR_ERR;
|
||||||
|
} while (buf[0] == 'R' && len < 1000000);
|
||||||
|
}
|
||||||
|
|
||||||
rigol_ds_set_wait_event(devc, WAIT_NONE);
|
rigol_ds_set_wait_event(devc, WAIT_NONE);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue