zeroplus: Modify analyzer_read_start to just prep for bulk reads.

Let the capture loop manage which samples are thrown out rather
than throwing out two here.

Signed-off-by: Russ Dill <Russ.Dill@gmail.com>
This commit is contained in:
Russ Dill 2013-12-31 16:25:51 -08:00 committed by Bert Vermeulen
parent bc059b42a2
commit aad031928e
3 changed files with 22 additions and 5 deletions

View File

@ -411,12 +411,10 @@ SR_PRIV void analyzer_wait(libusb_device_handle *devh, int set, int unset)
SR_PRIV void analyzer_read_start(libusb_device_handle *devh)
{
int i;
analyzer_write_status(devh, 3, STATUS_FLAG_20 | STATUS_FLAG_READ);
for (i = 0; i < 8; i++)
(void)gl_reg_read(devh, READ_RAM_STATUS);
/* Prep for bulk reads */
gl_reg_read_buf(devh, READ_RAM_STATUS, NULL, 0);
}
SR_PRIV int analyzer_read_data(libusb_device_handle *devh, void *buffer,

View File

@ -132,3 +132,21 @@ SR_PRIV int gl_reg_read(libusb_device_handle *devh, unsigned int reg)
ret = gl_read_data(devh);
return ret;
}
SR_PRIV int gl_reg_read_buf(libusb_device_handle *devh, unsigned int reg,
unsigned char *buf, unsigned int len)
{
int ret;
unsigned int i;
ret = gl_write_address(devh, reg);
if (ret < 0)
return ret;
for (i = 0; i < len; i++) {
ret = gl_read_data(devh);
if (ret < 0)
return ret;
buf[i] = ret;
}
return 0;
}

View File

@ -40,5 +40,6 @@ SR_PRIV int gl_read_bulk(libusb_device_handle *devh, void *buffer,
SR_PRIV int gl_reg_write(libusb_device_handle *devh, unsigned int reg,
unsigned int val);
SR_PRIV int gl_reg_read(libusb_device_handle *devh, unsigned int reg);
SR_PRIV int gl_reg_read_buf(libusb_device_handle *devh, unsigned int reg,
unsigned char *buf, unsigned int len);
#endif