X-Git-Url: http://sigrok.org/gitweb/?a=blobdiff_plain;f=src%2Fhardware%2Fhantek-dso%2Fapi.c;h=6a6aa09dc5e76068e3be6021386fb8e7024d2a24;hb=b6189f7c8af7d8eed6bdcf75fa05c95d8120c9b8;hp=e9aa4e5884f287532780aca1accaea4362777ccd;hpb=417412c8f88bd71fe5da5c80db0866d48c6908b3;p=libsigrok.git diff --git a/src/hardware/hantek-dso/api.c b/src/hardware/hantek-dso/api.c index e9aa4e58..6a6aa09d 100644 --- a/src/hardware/hantek-dso/api.c +++ b/src/hardware/hantek-dso/api.c @@ -33,14 +33,14 @@ #include #include #include "libsigrok-internal.h" -#include "dso.h" +#include "protocol.h" /* Max time in ms before we want to check on USB events */ /* TODO tune this properly */ #define TICK 1 -#define NUM_TIMEBASE 10 -#define NUM_VDIV 8 +#define NUM_TIMEBASE 10 +#define NUM_VDIV 8 #define NUM_BUFFER_SIZES 2 @@ -54,21 +54,21 @@ static const uint32_t drvopts[] = { static const uint32_t devopts[] = { SR_CONF_CONTINUOUS, - SR_CONF_LIMIT_FRAMES | SR_CONF_SET, SR_CONF_CONN | SR_CONF_GET, + SR_CONF_LIMIT_FRAMES | SR_CONF_SET, SR_CONF_TIMEBASE | SR_CONF_GET | SR_CONF_SET | SR_CONF_LIST, - SR_CONF_BUFFERSIZE | SR_CONF_GET | SR_CONF_SET | SR_CONF_LIST, + SR_CONF_NUM_HDIV | SR_CONF_GET, + SR_CONF_HORIZ_TRIGGERPOS | SR_CONF_GET | SR_CONF_SET, SR_CONF_TRIGGER_SOURCE | SR_CONF_GET | SR_CONF_SET | SR_CONF_LIST, SR_CONF_TRIGGER_SLOPE | SR_CONF_GET | SR_CONF_SET, - SR_CONF_HORIZ_TRIGGERPOS | SR_CONF_GET | SR_CONF_SET, - SR_CONF_NUM_HDIV | SR_CONF_GET, + SR_CONF_BUFFERSIZE | SR_CONF_GET | SR_CONF_SET | SR_CONF_LIST, SR_CONF_NUM_VDIV | SR_CONF_GET, }; static const uint32_t devopts_cg[] = { - SR_CONF_FILTER | SR_CONF_GET | SR_CONF_SET | SR_CONF_LIST, SR_CONF_VDIV | SR_CONF_GET | SR_CONF_SET | SR_CONF_LIST, SR_CONF_COUPLING | SR_CONF_GET | SR_CONF_SET | SR_CONF_LIST, + SR_CONF_FILTER | SR_CONF_GET | SR_CONF_SET | SR_CONF_LIST, }; static const char *channel_names[] = { @@ -389,7 +389,7 @@ static int dev_open(struct sr_dev_inst *sdi) err = libusb_claim_interface(usb->devhdl, USB_INTERFACE); if (err != 0) { sr_err("Unable to claim interface: %s.", - libusb_error_name(err)); + libusb_error_name(err)); return SR_ERR; } @@ -767,7 +767,7 @@ static void LIBUSB_CALL receive_transfer(struct libusb_transfer *transfer) num_samples = transfer->actual_length / 2; sr_spew("Got %d-%d/%d samples in frame.", devc->samp_received + 1, - devc->samp_received + num_samples, devc->framesize); + devc->samp_received + num_samples, devc->framesize); /* * The device always sends a full frame, but the beginning of the frame @@ -798,7 +798,7 @@ static void LIBUSB_CALL receive_transfer(struct libusb_transfer *transfer) /* The rest of this chunk starts with the trigger point. */ sr_dbg("Reached trigger point, %d samples buffered.", - devc->samp_buffered); + devc->samp_buffered); /* Avoid the corner case where the chunk ended at * exactly the trigger point. */ @@ -822,7 +822,7 @@ static void LIBUSB_CALL receive_transfer(struct libusb_transfer *transfer) /* That was the last chunk in this frame. Send the buffered * pre-trigger samples out now, in one big chunk. */ sr_dbg("End of frame, sending %d pre-trigger buffered samples.", - devc->samp_buffered); + devc->samp_buffered); send_chunk(sdi, devc->framebuf, devc->samp_buffered); /* Mark the end of this frame. */