From: Russ Dill Date: Tue, 3 Dec 2013 05:47:14 +0000 (-0800) Subject: zeroplus: Just wait until not busy on data capture X-Git-Tag: libsigrok-0.3.0~477 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=d20844e28b82704aaf0a5929d7078f57b6c59f5a;p=libsigrok.git zeroplus: Just wait until not busy on data capture While captures using a trigger do set the STATUS_READY bit, immediate captures do not set the STATUS_READY bit, they just clear the STATUS_BUSY bit. This was confirmed with packet captures using the "official" driver/app. --- diff --git a/hardware/zeroplus-logic-cube/analyzer.c b/hardware/zeroplus-logic-cube/analyzer.c index 79377f18..acb97e09 100644 --- a/hardware/zeroplus-logic-cube/analyzer.c +++ b/hardware/zeroplus-logic-cube/analyzer.c @@ -404,7 +404,7 @@ SR_PRIV void analyzer_wait(libusb_device_handle *devh, int set, int unset) while (1) { status = gl_reg_read(devh, DEV_STATUS); - if ((status & set) && ((status & unset) == 0)) + if ((!set || (status & set)) && ((status & unset) == 0)) return; } } @@ -614,7 +614,7 @@ SR_PRIV void analyzer_wait_button(libusb_device_handle *devh) SR_PRIV void analyzer_wait_data(libusb_device_handle *devh) { - analyzer_wait(devh, STATUS_READY | 8, STATUS_BUSY); + analyzer_wait(devh, 0, STATUS_BUSY); } SR_PRIV int analyzer_decompress(void *input, unsigned int input_len,