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:
parent
bc059b42a2
commit
aad031928e
|
@ -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)
|
SR_PRIV void analyzer_read_start(libusb_device_handle *devh)
|
||||||
{
|
{
|
||||||
int i;
|
|
||||||
|
|
||||||
analyzer_write_status(devh, 3, STATUS_FLAG_20 | STATUS_FLAG_READ);
|
analyzer_write_status(devh, 3, STATUS_FLAG_20 | STATUS_FLAG_READ);
|
||||||
|
|
||||||
for (i = 0; i < 8; i++)
|
/* Prep for bulk reads */
|
||||||
(void)gl_reg_read(devh, READ_RAM_STATUS);
|
gl_reg_read_buf(devh, READ_RAM_STATUS, NULL, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
SR_PRIV int analyzer_read_data(libusb_device_handle *devh, void *buffer,
|
SR_PRIV int analyzer_read_data(libusb_device_handle *devh, void *buffer,
|
||||||
|
|
|
@ -132,3 +132,21 @@ SR_PRIV int gl_reg_read(libusb_device_handle *devh, unsigned int reg)
|
||||||
ret = gl_read_data(devh);
|
ret = gl_read_data(devh);
|
||||||
return ret;
|
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;
|
||||||
|
}
|
||||||
|
|
|
@ -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,
|
SR_PRIV int gl_reg_write(libusb_device_handle *devh, unsigned int reg,
|
||||||
unsigned int val);
|
unsigned int val);
|
||||||
SR_PRIV int gl_reg_read(libusb_device_handle *devh, unsigned int reg);
|
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
|
#endif
|
||||||
|
|
Loading…
Reference in New Issue