]> sigrok.org Git - libsigrok.git/blobdiff - hardware/saleae-logic/saleae-logic.c
Whitespace and consistency fixes.
[libsigrok.git] / hardware / saleae-logic / saleae-logic.c
index f89d3ee2c29b96f27024246e7740bb6e07ad22e9..ba50ee94ea3ea6af15b47360d9cf2588eaf58ec7 100644 (file)
 #include <sigrok.h>
 #include "config.h"
 
-#define USB_VENDOR                     0x0925
+#define USB_VENDOR                 0x0925
 #define USB_PRODUCT                    0x3881
-#define USB_VENDOR_NAME                        "Saleae"
-#define USB_MODEL_NAME                 "Logic"
-#define USB_MODEL_VERSION              ""
+#define USB_VENDOR_NAME        "Saleae"
+#define USB_MODEL_NAME         "Logic"
+#define USB_MODEL_VERSION      ""
 
-#define USB_INTERFACE                  0
-#define USB_CONFIGURATION              1
-#define NUM_PROBES                     8
-#define NUM_TRIGGER_STAGES             4
-#define TRIGGER_TYPES                  "01"
-#define FIRMWARE                       FIRMWARE_DIR "/saleae-logic.fw"
+#define USB_INTERFACE          0
+#define USB_CONFIGURATION      1
+#define NUM_PROBES             8
+#define NUM_TRIGGER_STAGES     4
+#define TRIGGER_TYPES          "01"
+#define FIRMWARE               FIRMWARE_DIR "/saleae-logic.fw"
 
 /* delay in ms */
-#define FIRMWARE_RENUM_DELAY           2000
-#define NUM_SIMUL_TRANSFERS            10
-#define MAX_EMPTY_TRANSFERS            (NUM_SIMUL_TRANSFERS * 2)
+#define FIRMWARE_RENUM_DELAY   2000
+#define NUM_SIMUL_TRANSFERS    10
+#define MAX_EMPTY_TRANSFERS    (NUM_SIMUL_TRANSFERS * 2)
 
 /* Software trigger implementation: positive values indicate trigger stage. */
-#define TRIGGER_FIRED                  -1
+#define TRIGGER_FIRED          -1
 
 /* There is only one model Saleae Logic, and this is what it supports: */
 static int capabilities[] = {
@@ -54,6 +54,7 @@ static int capabilities[] = {
 
        /* These are really implemented in the driver, not the hardware. */
        HWCAP_LIMIT_SAMPLES,
+       HWCAP_CONTINUOUS,
        0,
 };
 
@@ -296,7 +297,7 @@ static int hw_init(char *deviceinfo)
        libusb_device **devlist;
        int err, devcnt, i;
 
-       /* QUICK HACK */
+       /* Avoid compiler warnings. */
        deviceinfo = deviceinfo;
 
        if (libusb_init(&usb_context) != 0) {
@@ -524,7 +525,7 @@ static int receive_data(int fd, int revents, void *user_data)
 {
        struct timeval tv;
 
-       /* QUICK HACK */
+       /* Avoid compiler warnings. */
        fd = fd;
        revents = revents;
        user_data = user_data;
@@ -654,7 +655,7 @@ void receive_transfer(struct libusb_transfer *transfer)
                g_free(cur_buf);
 
                num_samples += cur_buflen;
-               if ((unsigned int)num_samples > limit_samples) {
+               if (limit_samples && (unsigned int) num_samples > limit_samples) {
                        hw_stop_acquisition(-1, user_data);
                }
        } else {
@@ -727,7 +728,7 @@ static void hw_stop_acquisition(int device_index, gpointer session_device_id)
 {
        struct datafeed_packet packet;
 
-       /* QUICK HACK */
+       /* Avoid compiler warnings. */
        device_index = device_index;
 
        packet.type = DF_END;