ols: add feature to support >256K memory

Add support for the Pepino-style of accessing >256K of memory. Because
this the only known extension of accessing >256K currently, we apply it
as soon as the sample size is bigger than 256K.  Let's hope other
devices (if any) will follow this style. If not, we need to add support
depending on the device name later.

Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
This commit is contained in:
Wolfram Sang 2019-01-02 13:15:25 +01:00 committed by Uwe Hermann
parent ec26d9e1df
commit f6ce25ec05
2 changed files with 24 additions and 6 deletions

View File

@ -464,12 +464,28 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi)
/* Send sample limit and pre/post-trigger capture ratio. */
sr_dbg("Setting sample limit %d, trigger point at %d",
(readcount - 1) * 4, (delaycount - 1) * 4);
arg[0] = ((readcount - 1) & 0xff);
arg[1] = ((readcount - 1) & 0xff00) >> 8;
arg[2] = ((delaycount - 1) & 0xff);
arg[3] = ((delaycount - 1) & 0xff00) >> 8;
if (send_longcommand(serial, CMD_CAPTURE_SIZE, arg) != SR_OK)
return SR_ERR;
if (devc->max_samples > 256 * 1024) {
arg[0] = ((readcount - 1) & 0xff);
arg[1] = ((readcount - 1) & 0xff00) >> 8;
arg[2] = ((readcount - 1) & 0xff0000) >> 16;
arg[3] = ((readcount - 1) & 0xff000000) >> 24;
if (send_longcommand(serial, CMD_CAPTURE_READCOUNT, arg) != SR_OK)
return SR_ERR;
arg[0] = ((delaycount - 1) & 0xff);
arg[1] = ((delaycount - 1) & 0xff00) >> 8;
arg[2] = ((delaycount - 1) & 0xff0000) >> 16;
arg[3] = ((delaycount - 1) & 0xff000000) >> 24;
if (send_longcommand(serial, CMD_CAPTURE_DELAYCOUNT, arg) != SR_OK)
return SR_ERR;
} else {
arg[0] = ((readcount - 1) & 0xff);
arg[1] = ((readcount - 1) & 0xff00) >> 8;
arg[2] = ((delaycount - 1) & 0xff);
arg[3] = ((delaycount - 1) & 0xff00) >> 8;
if (send_longcommand(serial, CMD_CAPTURE_SIZE, arg) != SR_OK)
return SR_ERR;
}
/* Flag register. */
sr_dbg("Setting intpat %s, extpat %s, RLE %s, noise_filter %s, demux %s",

View File

@ -42,6 +42,8 @@
#define CMD_SET_DIVIDER 0x80
#define CMD_CAPTURE_SIZE 0x81
#define CMD_SET_FLAGS 0x82
#define CMD_CAPTURE_DELAYCOUNT 0x83 /* extension for Pepino */
#define CMD_CAPTURE_READCOUNT 0x84 /* extension for Pepino */
#define CMD_SET_TRIGGER_MASK 0xc0
#define CMD_SET_TRIGGER_VALUE 0xc1
#define CMD_SET_TRIGGER_CONFIG 0xc2