]> sigrok.org Git - libsigrok.git/blobdiff - src/hardware/sysclk-lwla/protocol.h
Fix a few "value never read" scan-build warnings.
[libsigrok.git] / src / hardware / sysclk-lwla / protocol.h
index 1e353ad6a36b9d4344d98c0f737da8e922ecabc7..aedac6ee325374212827fbacbf4ef98b1287fbcd 100644 (file)
 
 #define LOG_PREFIX "sysclk-lwla"
 
-#include "lwla.h"
-#include "libsigrok.h"
-#include "libsigrok-internal.h"
 #include <stdint.h>
 #include <glib.h>
+#include <libsigrok/libsigrok.h>
+#include "libsigrok-internal.h"
+#include "lwla.h"
 
 /* For now, only the LWLA1034 is supported.
  */
@@ -34,8 +34,9 @@
 #define MODEL_NAME     "LWLA1034"
 
 #define USB_VID_PID    "2961.6689"
+#define USB_CONFIG     1
 #define USB_INTERFACE  0
-#define USB_TIMEOUT    3000 /* ms */
+#define USB_TIMEOUT_MS 3000
 
 #define NUM_CHANNELS   34
 
@@ -46,7 +47,7 @@
 /** Unit and packet size for the sigrok logic datafeed.
  */
 #define UNIT_SIZE      ((NUM_CHANNELS + 7) / 8)
-#define PACKET_LENGTH  10000   /* units */
+#define PACKET_LENGTH  (10 * 1000)     /* units */
 
 /** Size of the acquisition buffer in device memory units.
  */
@@ -207,10 +208,10 @@ struct dev_context {
        /** The samplerate selected by the user. */
        uint64_t samplerate;
 
-       /** The maximimum sampling duration, in milliseconds. */
+       /** The maximum sampling duration, in milliseconds. */
        uint64_t limit_msec;
 
-       /** The maximimum number of samples to acquire. */
+       /** The maximum number of samples to acquire. */
        uint64_t limit_samples;
 
        /** Channels to use. */
@@ -241,6 +242,9 @@ struct dev_context {
        /** Trigger slope configuration setting. */
        enum signal_edge cfg_trigger_slope;
 
+       /** Whether a running acquisition should be canceled. */
+       gboolean cancel_requested;
+
        /* Indicates that stopping the acquisition is currently in progress. */
        gboolean stopping_in_progress;
 
@@ -252,7 +256,6 @@ SR_PRIV struct acquisition_state *lwla_alloc_acquisition_state(void);
 SR_PRIV void lwla_free_acquisition_state(struct acquisition_state *acq);
 
 SR_PRIV int lwla_init_device(const struct sr_dev_inst *sdi);
-SR_PRIV int lwla_convert_trigger(const struct sr_dev_inst *sdi);
 SR_PRIV int lwla_set_clock_config(const struct sr_dev_inst *sdi);
 SR_PRIV int lwla_setup_acquisition(const struct sr_dev_inst *sdi);
 SR_PRIV int lwla_start_acquisition(const struct sr_dev_inst *sdi);
@@ -260,4 +263,4 @@ SR_PRIV int lwla_abort_acquisition(const struct sr_dev_inst *sdi);
 
 SR_PRIV int lwla_receive_data(int fd, int revents, void *cb_data);
 
-#endif /* !LIBSIGROK_HARDWARE_SYSCLK_LWLA_PROTOCOL_H */
+#endif